Using AWS ELB, I was able to serve HTTP (via uwsgi) and websockets through 
Nginx with Nginx handling the SSL certs. 

Once I tried to offloading SSL certs to the ELB so I could capture 
X-Forwarded-For, websockets fail to route/upgrade to Daphne and I get "Not 
Found: /ws/" in uwsgi's logs.

Here is the relevant (working) piece of Nginx .conf file using TCP/443 pass 
thru from the ELB:

location /ws {
            proxy_pass http://unix:/opt/toogo/run/r117.0.4.3720.ws;  
 #Obviously daphne is listening here
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_http_version 1.1;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $host;
    }

What change is required if I offload the SSL certs to the ELB and introduce 
X-Forwarded-for?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/000177ac-6f1e-4b51-8e7a-efa55630d53f%40googlegroups.com.

Reply via email to