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
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This question was answered by @vegardx
Since you’re doing proxypass to localhost it will be whatever resolves to localhost in your /etc/hosts-file that makes it bind to that interface. Change out localhost with 127.0.0.1 in your proxypass and you’ll pass it only to 127.0.0.1.
This comment has been deleted
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.