我在云和云上部署节点应用程序使用nginx进行反向代理我可以请求GET方法但我不能请求POST方法。请帮助我允许POST方法。
我的配置
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
server_name localhost;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://localhost:3000;
proxy_redirect off;
}
}
NginX中的错误日志显示
2017/03/14 09:21:00 [warn] 10102#10102: invalid value "POST" in /etc/nginx/sites-enabled/default:58
2017/03/14 09:21:00 [warn] 10105#10105: invalid value "POST" in /etc/nginx/sites-enabled/default:58
2017/03/14 10:17:10 [error] 13483#13483: *6 upstream timed out (110: Connection timed out) while reading response header from upstream, client: xxx.xx.xx.xxx, server: localhost, request: "POST /api/v1/users/$
2017/03/14 10:21:42 [error] 13483#13483: *11 upstream timed out (110: Connection timed out) while reading response header from upstream, client: xxx.xx.xx.xxx, server: localhost, request: "POST /api/v1/users$