0

I have a couple of services that fetches data via my REST api from the backend. This all worked fine, until I enabled SSL on the server.

Now the the requests never reach the server, chrome network inspector indicates that those requests are "cancelled" and "pending"

Note The frontend is running on the same domain, and via ssl.

Just in case this is something to do with my server config, here it is:

worker_processes  auto;

events {
    worker_connections  1024;
}

http {
    include       ${buildout:directory}/parts/nginx/conf/mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  70;

    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;

    server {
        listen      80;
        server_name localhost;
        rewrite     ^   https://$server_name$request_uri? permanent;
    }

    server {
        server_name localhost;
        listen 443;
        access_log  ${logs:access_log};

        ssl on;
        ssl_certificate ${buildout:directory}/dev/server.crt;
        ssl_certificate_key ${buildout:directory}/dev/server.key;

        location ^~ /media/ {
            root ${opts:media_dir};
            expires 31d;
        }

        location ^~ /static/ {
            root ${opts:media_dir};
            expires 31d;
        }

        location / {
            proxy_pass http://unix:${opts:socketfile}:;
            proxy_pass_header Server;
            proxy_set_header Host $http_host;
            proxy_redirect off;
            proxy_connect_timeout 10;
            proxy_read_timeout 10;

            proxy_set_header X-Scheme $scheme;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For  $remote_addr;
            # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
    }
}

Thank you!

4

1 回答 1

0

Issue resolved. Turns out I had an extra nginx webserver running and I was restarting the wrong one every time I updated configuration. Killing the rogue nginx server and reloading the correct one fixed the problem.

于 2013-09-14T18:44:13.870 回答