0

This configuration was working before, and now it is not.

I should mention this is Django,Gunicorn, and Nginx.

We are trying to make https://toontowninfinite.com/rpc/ use http, not SSL. and the rest of the site use SSL.

This is the config:

server {
        listen 80;
        # Force HTTPS!
        server_name toontowninfinite.com;

        # Well, excluding the RPC server. (thanks chan!)
        location /rpc/ {
                proxy_set_header Host $host;
                proxy_pass http://toontowninfinite;
        }
        location / {
                rewrite ^  https://$server_name$request_uri? permanent;
                add_header Access-Control-Allow-Origin *;
        }
}

I do not see anything wrong here, any suggestions as to why it is forcing still?

Thanks.

  • What you are trying to do using `proxy_pass http://toontowninfinite;` ? – skbly7 Jul 25 '15 at 07:09
  • All i am wanting to do, is make it how i explained it above, if i am doing it wrong..just want it fixed. – Kevin Hammett Jul 25 '15 at 15:59
  • No, I meant seeing your config, it seems you wish to open http version of website on using /rpc/ (/rpc would open /, and so on...), and if /rpc/ isn't present then https version. Am I right ? – skbly7 Jul 25 '15 at 21:43
  • If yes, then in /rpc/ location, just add a header in proxy_pass, and check for it (when forcing https). Here is how to add a header : http://stackoverflow.com/questions/14501047/how-to-add-a-response-header-on-nginx-when-using-proxy-pass – skbly7 Jul 25 '15 at 21:44

0 Answers0