docker and jwilder/nginx-proxy http/https issue -
i'm using docker on osx via boot2docker
.
i have 2 hosts: site1.loc.test.com
, site2.loc.test.com
pointed ip address of docker host.
both should available via 80
, 443
ports.
so i'm using jwilder/nginx-proxy
reverse proxy purposes.
but in fact when i'm running of them via docker-compose
every time try open via 80
port redirect 443
(301 moved permanently)
.
may i've missed in jwilder/nginx-proxy
configuration?
docker-compose.yml
proxy: image: jwilder/nginx-proxy volumes: - /var/run/docker.sock:/tmp/docker.sock:ro - certs:/etc/nginx/certs ports: - "80:80" - "443:443" site1: image: httpd:2.4 volumes: - site1:/usr/local/apache2/htdocs environment: virtual_host: site1.loc.test.com expose: - "80" site2: image: httpd:2.4 volumes: - site2:/usr/local/apache2/htdocs environment: virtual_host: site2.loc.test.com expose: - "80"
i think configuration should correct, seems intended behaviour of jwilder/nginx-proxy
. see these lines in file nginx.tmpl
: https://github.com/jwilder/nginx-proxy/blob/master/nginx.tmpl#l89-l94
it seems if certificate found, redirected https.
edit: found confirmation in documentation
the behavior proxy when port 80 , 443 exposed follows:
- if container has usable cert, port 80 redirect 443 container https preferred when available.
you can still use custom configuration. try override file nginx.tmpl
in new dockefile .
Comments
Post a Comment