返回顶部

收藏

nginx收到post或者put请求后不再轮询而是直接显示报错信息的配置

更多
upstream mash {
    ip_hash;
    server 127.0.0.1:8081;
    server 192.168.0.11:8081;
}

server {

    location / {
        if ($request_method = POST ) {
          proxy_next_upstream error;
        }

        if ($request_method = PUT ) {
          proxy_next_upstream error;
        }

        proxy_pass http://mash/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;        
    }
}

标签:post,nginx,put

收藏

0人收藏

支持

0

反对

0