Open domenix opened 3 years ago
Thanks for the report, I'll take a look into this when I get a moment
FYI: When running in a 3 container setup the headers are correctly send.
Thanks @rutger1140. I haven't had chance to work on this yet but if anyone wants to contribute a PR I'll be happy to review and merge.
cc @domenix
It’s no issue for me currently.
While I got ahold of you, could you perhaps checkout two PR’s that are pending? We’ve been running our own fork just because of these two.
Thanks!
@rutger1140 yep, all sorted. Sorry for the delay in this, and thank you!
@rutger1140 v1.2.4 pushed to docker hub FYI
@rutger1140 yep, all sorted. Sorry for the delay in this, and thank you!
Happy to help!
Quite handy project, but I think there is a small issue. When I am defining a container behind an nginx-proxy, and I try to query the source domain using
curl -i subdomain.owndomain.com
the message is always:301 Moved Permanently
, no matter what redirect code do I define.301 code
``` example@PC:/mnt/c$ curl -i subdomain.owndomain.com HTTP/1.1 301 Moved Permanently Date: Mon, 02 Aug 2021 23:57:45 GMT Content-Type: text/html Transfer-Encoding: chunked Connection: keep-alive Location: https://subdomain.owndomain.com/ CF-Cache-Status: DYNAMIC Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=301 Moved Permanently
See below an example docker-compose file which is an excerpt from my configuration.
docker-compose.yaml
```yml version: '3.8' services: nginx-proxy: image: jwilder/nginx-proxy:alpine container_name: nginx-proxy ports: - 80:80 - 443:443 volumes: - conf:/etc/nginx/conf.d - certs:/etc/nginx/certs:ro - vhost:/etc/nginx/vhost.d - dhparam:/etc/nginx/dhparam - html:/usr/share/nginx/html - /dev/urandom:/dev/random - /var/run/docker.sock:/tmp/docker.sock:ro labels: - "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy" restart: always nginx-proxy-acme: image: nginxproxy/acme-companion container_name: nginx-proxy-acme depends_on: - nginx-proxy volumes: - certs:/etc/nginx/certs - vhost:/etc/nginx/vhost.d - html:/usr/share/nginx/html - acme:/etc/acme.sh - /dev/urandom:/dev/random - /var/run/docker.sock:/var/run/docker.sock:ro environment: NGINX_PROXY_CONTAINER: nginx-proxy restart: always example_redirect: image: adamkdean/redirect container_name: example_redirect volumes: - /dev/urandom:/dev/random - /var/run/docker.sock:/var/run/docker.sock:ro environment: - VIRTUAL_HOST=subdomain.owndomain.com - REDIRECT_LOCATION="https://example.com" - REDIRECT_STATUS_CODE=302 restart: always volumes: conf: vhost: html: dhparam: certs: acme: networks: default: external: true name: nginx-proxy ```