[Nginx + webrick] Autocomplete request to localhost
I am using Nginx with "proxy_pass http://127.0.0.1:3000;" and ?webrick? (script/server).
Everything works fine except autocomplete.
Apparently the browser is sending the requests to "Request URL:http://127.0.0.1:3000/contexts.autocomplete?term=A" instead of https://$server_ip/[...] where it would be passed by nginx to localhost.
I saw the "Don't use Ajax for autocomplete" ticket, but is there a fix that would work for me now?
Everything works fine except autocomplete.
Apparently the browser is sending the requests to "Request URL:http://127.0.0.1:3000/contexts.autocomplete?term=A" instead of https://$server_ip/[...] where it would be passed by nginx to localhost.
I saw the "Don't use Ajax for autocomplete" ticket, but is there a fix that would work for me now?
Leave a comment
on 2013-05-09 02:17 *
By tiefighter
Ah, got it working with that line + "proxy_set_header X-Forwarded-Proto https;"
->
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
Thanks!
->
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
Thanks!