Docker-letsencrypt-nginx-proxy-companion: Support for static reverse proxying with SSL

Created on 8 Feb 2017  路  6Comments  路  Source: nginx-proxy/docker-letsencrypt-nginx-proxy-companion

Add support for proxy destinations that are "off-box" and not in docker containers. For example, It would be great to be able to have an encrypted connection land on the nginx-proxy docker container, and then travel unencrypted to the destination server (which isn't a container).

nginx-proxy supports adding a configuration file to achieve this end, but nginx-letsencrypt has no method to handle generating/managing the certificates for this sort of situation.

Perhaps permit allowing some environment variables for passing in additional hostnames/emails for certificates that should be managed, regardless of container existence?

Duplicate Enhancement

Most helpful comment

if you are still having problem with it, I solved it by using another nginx container to serve the static directory, like so:

# other lines

static-main-site:
     restart: always
     image: nginx:alpine
     volumes:
       - ./static/path:/usr/share/nginx/html:ro
     environment:
       - VIRTUAL_HOST=www.domain.com,domain.com
       - VIRTUAL_NETWORK=nginx-proxy
       - VIRTUAL_PORT=80
       - LETSENCRYPT_HOST=www.domain.com,domain.com
       - [email protected]

All 6 comments

Dupe of #127, though that one was arguably never resolved.

Yeah, only a workaround, would be interested in this

The best is perhaps to use another solution like traefik

if you are still having problem with it, I solved it by using another nginx container to serve the static directory, like so:

# other lines

static-main-site:
     restart: always
     image: nginx:alpine
     volumes:
       - ./static/path:/usr/share/nginx/html:ro
     environment:
       - VIRTUAL_HOST=www.domain.com,domain.com
       - VIRTUAL_NETWORK=nginx-proxy
       - VIRTUAL_PORT=80
       - LETSENCRYPT_HOST=www.domain.com,domain.com
       - [email protected]

I would love to be able to put some config somewhere for a reverse https proxy with letsencrypt SSL. This would also work if u for some reason don't want to use docker socket (or u can't).

An experimental feature allowing to generate certificates from a config file instead of containers env var (inspired by @ymettier PR #220) has been added to dev.

This instructions are here. Any feedback is welcome.

Closing in favor of #368 so we can keep track of this in a single issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DatAres37 picture DatAres37  路  5Comments

synopsisdevs picture synopsisdevs  路  7Comments

bassail picture bassail  路  4Comments

nwallace picture nwallace  路  5Comments

maitrungduc1410 picture maitrungduc1410  路  5Comments