• http to http
  • tcp:443 to tcp:443 (for SSL termination in Nginx)
  • Health check: https over 443

Nginx configured as:

  • two separate server blocks. One with 443 ssl and one for 80.

AWS instance:

  • one instance with security group for incoming 443 and 80 traffic from load balancer only. Outgoing to the world.

Issue: we need ssl termination on Nginx so as to pass penetration tests for one of our clients. Since switching ssl from load balancer to Nginx our login page switches from https to http after logging in which causes page to fail to load (I have no reasoning as to why). Our thought process was to simply have Nginx redirect this http traffic over to https but I have attempted multiple types of configuration with no success. I have used:

return 301 https://$host$request_uri



under the 80 block of Nginx (I am unable to post more than two links so I removed portions of that code). As a test I try to get to the login page itself using http and all I get is a white page that eventually displays an error about page could not be reached. Any insight would be helpful. I've thought about using a rewrite rule but I keep reading that using return would be better.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.