Skip to content

Instantly share code, notes, and snippets.

@fortunto2
Created September 26, 2018 15:11
Show Gist options
  • Save fortunto2/92674590973bc7ff286ee7b1473fc23b to your computer and use it in GitHub Desktop.
Save fortunto2/92674590973bc7ff286ee7b1473fc23b to your computer and use it in GitHub Desktop.
Uppy server companion setting to nginx

I set this to solve wss error transloadit/uppy#1075


server {
        server_name uppy.xxxxx.com;
        charset utf-8;

        location / {
                proxy_pass http://0.0.0.0:3020;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

    location /api {
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "Upgrade";
            proxy_set_header Proxy "";
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_pass http://0.0.0.0:3020;
    }

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment