Report this

What is the reason for this report?

Node.js - Nginx 502 Bad Gateway on POST/PUT

Posted on October 25, 2014

Hi,

I have a MEAN app and on localhost works fine.

I have a CentOs droplet with node.js and nginx, but that i make for example a submit form by POST or PUT, console returns “502 Bad Gateway”.

Each time i restart nginx, shows: nginx: [emerg] unknown directive “proxy_http_version”

My conf in nginx:

server {
    listen 80;
    server_name mysub.domain.com
    location / {
        proxy_pass http://localhost:3003;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_connect_timeout       300;
        proxy_send_timeout          300;
        proxy_read_timeout          300;
        send_timeout                300;
    }
}

My niginx version is 1.0.15

Thanks for now. =D

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.