DanielDent / docker-nginx-ssl-proxy

SSL Front-End Proxy With Automatic Free Certificate Management
https://hub.docker.com/r/danieldent/nginx-ssl-proxy/
Other
204 stars 68 forks source link

How set proxy_set_header? #22

Closed sgehrman closed 5 years ago

sgehrman commented 5 years ago

Sorry for the noob question. I'm having problems and I was told I need:

proxy_set_header  X-Forwarded-Proto $scheme;

Where and how do I set this?

I see it is set in the default.conf, but something is wrong. Is X-Forwarded-Proto deprecated? Is there a better way now? https://support.cocoatech.com is the site I'm trying to fix. My css files aren't loading because they are referenced with http://. I was told that I need X-Forwarded-Proto to make that work.

Thanks

DanielDent commented 5 years ago

You'll probably want to update your CSS references. X-Forwarded-Proto is always set by this container automatically, there is nothing you need to do for that header to be present.

sgehrman commented 5 years ago

I can't do that as it's controlled by another site. tenderapp.com That site is http, but I added this proxy to get it to work at https. Their support guy said I need this forward-proto. I see it's there, but not sure why it's not working.

I don't see X-Forwarded-Proto in the reponse header. Should it be there?

sgehrman commented 5 years ago

The guy at tender helped me fix it.

Changed 3 things in the default.conf

1) add 443: server cocoatech.tenderapp.com:443; 2) removed: proxy_set_header X-Forwarded-Proto $scheme; 3) https, not http on: proxy_pass https://origin;