Report this

What is the reason for this report?

nginx, 405 Not allowed against PUT method

Posted on October 9, 2013

Hi there! Please help, I’m trying to make my nginx reverse proxy work with my node.js restful api, but always getting 405 Not allowed error on PUT request. I’ve already tried to include “dav_methods PUT DELETE;” line in my config but it seems not working. Server runs with --with-http_dav_module flag in Ubuntu 12.04. here is my config: server { listen 80;

server_name howconscious.ru;

location /site/ {
    dav_methods PUT DELETE;
    proxy_pass http://localhost:1337/;
    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;
}

} Thanks in advance!



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!

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.

Check out <a href=“https://www.digitalocean.com/community/articles/how-to-host-multiple-node-js-applications-on-a-single-vps-with-nginx-forever-and-crontab”>How To Host Multiple Node.js Applications On a Single VPS with nginx, forever, and crontab</a>

Have you restarted nginx after editing the config file?

thank for the answers, I restart the server every time I edit the config, and my config is taken exactly from that local tutorial. I’ve googled a lot of stuff on this topic and this problem seems unsolvable, thus nginx reverse proxy doesn’t allow to use at least PUT and DELETE methods

The developer cloud

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

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.