Cloud9csi
By:
Cloud9csi

Fileupload feature is not working with Nginx and Nodejs combination in Ubntu droplet

November 22, 2017 101 views
Node.js Nginx Ubuntu 16.04

Fileupload feature works on my NodeJs application running locally on my machine. But when i upload the app on Ubuntu droplet with Nginx, everything works but the fileupload. I have to say, i am very new to Nginx and may be i am missing something very simple. Here is the content of my /etc/nginx/sites-available/default file

# HTTP — redirect all traffic to HTTPS
server {
listen 80;
listen [::]:80 defaultserver ipv6only=on;
return 301 https://$host$request
uri;
}

# HTTPS — proxy all requests to the Node app
server {
# Enable HTTP/2
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name abcd.com;

location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-NginX-Proxy true;
    proxy_pass http://localhost:5000/;
    proxy_ssl_session_reuse off;
    proxy_set_header Host $http_host;
    proxy_cache_bypass $http_upgrade;
    proxy_redirect off;
}

}

Be the first one to answer this question.