I used passenger standalone for my app. currently my app is running on both http and https . i want to redirect all http request to https. I used load balancer in my application. I read this articles
https://aws.amazon.com/premiumsupport/knowledge-center/redirect-http-https-elb/
https://www.phusionpassenger.com/library/config/standalone/intro.html#nginx-configuration-template
i tried this 2 methods
1)
if ($http_x_forwarded_proto = "http") {
return 301 https://$host$request_uri;
}
2)
if ($http_x_forwarded_proto != "https") {
rewrite ^(.*)$ https://$server_name$REQUEST_URI permanent;
}
i tried all process in same way. but every time it goes in to infinite loop and before i start passenger the instance terminate itself and create new instance because of too many request timeout.
I can't figure out, whether it is issue of elastic load balancer or passenger config. I think when i stop passenger and user try to access app. the request time out generated and due to that new instance created. i am not sure.
Thanks in advance :)
proxy_set_header X-Forwarded-Proto https;
However, if you edit your post and show us your NGINX configuration we might be able to help you more. – Gumpcurl -I http://your.domain.here.tld
– Bibliophilecurl -I http://app.singaporeswimming.com
HTTP/1.1 301 Moved Permanently
Cache-Control: no-cache
Content-Length: 105
Content-Type: text/html
Date: Fri, 17 Nov 2017 04:54:54 GMT
Location: http://app.singaporeswimming.com/manage
Server: nginx/1.8.0 + Phusion Passenger 5.0.14
Status: 301 Moved Permanently
X-Powered-By: Phusion Passenger 5.0.14
X-Rack-CORS: preflight-hit; no-origin
X-Request-Id: dd0db076-c687-48dc-be1a-28b369a3f2b0
X-Runtime: 0.001350
Connection: keep-alive
` – Assemblagessl_port
,ssl_certificate
, andssl_certificate_key
. – Bibliophilehttps://textb.org/t/vishal/
. i exactly used thishttps://www.phusionpassenger.com/library/config/standalone/intro.html#nginx-configuration-template
. @puneet18, yes i also used all ssl certificate e.gpassenger start -p 80 --ssl --ssl-certificate /etc/ssl/ssl-bundle.crt --ssl-certificate-key /etc/ssl/app.singaporeswimming.key --ssl-port 443 -d -e production
– Assemblagecp $(passenger-config about resourcesdir)/templates/standalone/config.erb nginx.conf.erb
then you need to update Passenger. – Bibliophileinclude_passenger_internal_template
. i tried all the code of that file, is it version issue ? passenger version isPhusion Passenger version 5.0.14
. – Assemblage5.3.3
and installed passenger systemPhusion Passenger version 4.0.53
. i forgot where to write that if condition :( . can you help me out ? – Assemblage