Ngninx not working with and ssl

  • Posted November 3, 2019
  • Nginx

I have been trying to get nginx to play well with and my ssl configuration for a while. I can get to my site perfectly fine (over https) and everything functions properly except for the communication and when I open the debugging console I don’t see any WS available or running. My config file is like this:

server {

    listen [::]:80;
    listen 80;

    access_log  /var/log/nginx/access.log;

    proxy_set_header X-Forwarded-Proto $scheme;
        if ( $http_x_forwarded_proto != 'https' ) {
        return 301 https://$host$request_uri;

    location / {
        include proxy_params;

    location / {
        include proxy_params;
        proxy_http_version 1.1;
        proxy_cache_bypass $http_upgrade;
        proxy_buffering off;
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";

and my app is running with flask/gunicorn:

gunicorn --timeout=300 -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 app:app

Any help would be greatly appreciated!


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello, @ecda909

May I ask if you have checked our tutorial on how to server flash applications with gunicorn and Nginx:

If you’re not running Ubuntu 18.04 you can choose a different distro from here:

Hope this helps. Let me know how it goes.

Regards, Alex