POST request not allowed - 405 Not Allowed - nginx, even with headers included

后端 未结 6 1149
孤独总比滥情好
孤独总比滥情好 2020-11-29 20:23

I have a problem in trying to do a POST request in my application and I searched a lot, but I did not find the solution.

So, I have a nodeJS application and a websi

6条回答
  •  离开以前
    2020-11-29 21:10

    This configuration to your nginx.conf should help you.

    https://gist.github.com/baskaran-md/e46cc25ccfac83f153bb

    server {
        listen       80;
        server_name  localhost;
    
        location / {
            root   html;
            index  index.html index.htm;
        }
    
        error_page  404     /404.html;
        error_page  403     /403.html;
    
        # To allow POST on static pages
        error_page  405     =200 $uri;
    
        # ...
    }
    

提交回复
热议问题