Nginx proxy_redirect

The information you’re about to submit is not secure

Because the site is using a connection that’s not completely secure, your information will be visible to others.

Chrome v86 started warning users about insecure forms. An odd configuration where Nginx was sitting in front of an IIS box was throwing the warning to users, seemingly because IIS wasn’t aware of the SSL layer that Nginx was putting on.

The solution. Adding the following line into the location block in Nginx.

proxy_redirect http://$host/ https://$host/;

No more warnings and now the browser stays inside of https land. Excellent.

By using the $host variable, instead of the actual hostname it allows this to be used inside of a snippet and used across multiple websites without having to change anything.

One thought on “Nginx proxy_redirect”

Leave a Reply to Anonymous Cancel reply

Your email address will not be published. Required fields are marked *