nginx-proxy / docker-gen

Generate files from docker container meta-data
MIT License
4.46k stars 604 forks source link

Project still active ? #302

Closed tbpoetke closed 3 years ago

tbpoetke commented 5 years ago

Hi,

someone knows if this project is still active? Looks like last commit is 3 month ago and alot of not merged pull requests. Maybe there is a active fork somewhere around? Still have problems with not restarting nginx-gen, and issue about this topic is open for a while now, and I cant see any answeres from Jwilder somewhere :(

sikmir commented 5 years ago

Why do you still need docker-gen? Consider switching to Traefik, it solves the same problem.

tbpoetke commented 5 years ago

Why do you still need docker-gen? Consider switching to Traefik, it solves the same problem.

it´s somehow different :D I tried Traefik, but I have other problems with it, much less Documentation and help for Treafik at the moment, and I wasn´t able to get Collabora to run with Traefik and I´m not alone with this Problem :(

silverbackdan commented 5 years ago

@sikmir you may not have helped @Aschenbecher but this little comment made me find Traefik and I hadn't seen it before. It is exactly what I was after. I started adding in a new environment variable and then adjusting the template to fit, but that is the one.

For those looking to do www redirects, if the goal is to have a single place to redirect your domain to you can add a new environment variable DEFAULT_REDIRECT_HOST then add this into the tmpl:

{{/* Get the DEFAULT_REDIRECT_HOST defined by containers w/ the same vhost */}}
{{ $redirect_host := trim (or (first (groupByKeys $containers "Env.DEFAULT_REDIRECT_HOST")) $host) }}

Change the 301 redirect line for https redirects to return 301 https://{{ $redirect_host }}$request_uri;

and in the server blocks wrap this around before you include the vhosts (that goes in the else bit)

{{ if ne $redirect_host $host }}
    return 301 https://{{ $redirect_host }}$request_uri;
{{ else }}
    ....
{{ end }}

Something like that should work and be configurable per domain I think Related: https://github.com/jwilder/nginx-proxy/issues/1254

I did almost get a more complicated redirect variable working, but the scoping of variables in the golang text templates makes it very difficult to do within the tmpl file and I don't know enough go to customise any other bits.

IAMtheIAM commented 5 years ago

This is a good project, but getting stale without any active merging of PRs

thomasd3 commented 5 years ago

as a quick note: I came to this project after I was using Traefik and looking for an alternative.

k3a commented 5 years ago

Why should Traefik be better? I really like Nginx, it is an industry standard and supports many plugins including modsecurity. There doesn't seem to be WAF in Traefik for example (https://github.com/containous/traefik/issues/431 and no custom plugins https://github.com/containous/traefik/issues/1336). Traefik also doesn't have the control plane and data plane separated (it is in Traefik Enterprise Edition only) so if Traefik is hacked, the attacker could access the docker socket.

It is also popular to use Nginx for Kubernetes ingress https://github.com/kubernetes/ingress-nginx.

And docker-gen is capable of generating basically any configuration file, not just for Nginx. This project makes sense to me but probably needs a new maintainer.

sudomabider commented 4 years ago

Like others have said, docker-gen is more general purpose than just part of an ingress. And Nginx is our go to reverse proxy any day.

We do use Traefik and love it for what it does. Unfortunately we also need fastcgi for some services which Traefik is currently not planning to support. Docker-gen actually solves our problems perfectly. When used with Nginx, the fact that we can maintain our own nginx.tmpl gives us full control over things which is a godsend.

Be really sad to see this project go.