简体   繁体   中英

Nginx redirect all POST traffic to another server

I am in the middle of setting up a 3 node web server cluster running Nginx , Apache 2 and MySQL.

The question is this. In my rewrite rules on web server 2 - 3 I want to direct all POST traffic to Web Server 1 ( on the private network if possible). All servers are behind a load balancer.

So what would I need to put in the conf file for the vhost to redirect all traffic to Web server 1?

Thanks

if ($request_method = POST) {
  proxy_pass http://server1;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM