redirect HTTP traffic to HTTPS - Passenger Standalone with AWS - Elastic Load Balancer

107 views
Skip to first unread message

Vishal Sadriya

unread,
Nov 9, 2017, 5:41:42 AM11/9/17
to Phusion Passenger Discussions (deprecated)
I am using Passenger Standalone with AWS  load balancer . I want to redirect HTTP traffic to HTTPS. I found this article https://aws.amazon.com/premiumsupport/knowledge-center/redirect-http-https-elb/ 
for redirect http request to https . but it is only for nginx config.  I followed this https://www.phusionpassenger.com/library/config/standalone/intro.html#nginx-configuration-template tutorial and added custom file for nginx.conf.erb 
`     <% if $http_x_forwarded_proto != "https" %>
          rewrite ^(.*)$ https://example.com permanent;
        <% end %>` 

and this code under the` server { ` but its not working and going to infinte loop that's why instance terminate itself. Tried all the tutorials but not working yet.
Reply all
Reply to author
Forward
0 new messages