This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
8
Getting 400 (BAD REQUEST) with nginx + gunicorn + socketio
Post Body
Website is running on http and socketio connections can be established fine but when I configure it for https socketio connections can not be established although rest of the website works fine.
server {
listen 80 default_server;
server_name my_domain;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name my_domain;
ssl_certificate /etc/letsencrypt/live/domain/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
include /etc/nginx/proxy_params;
proxy_pass http://localhost:8000;
}
location /static {
alias /app/static;
expires 30d;
}
location /socket.io {
include /etc/nginx/proxy_params;
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://127.0.0.1:8000/socket.io;
}
}
And running the python file with gunicorn
gunicorn3 -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 application:app
I have used this exact setup on my local network with self signed certificates it has worked just fine. This time I am using letsencrypt (certbot). What is it that I am doing wrong?
​
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 4 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/flask/comme...