nginx 根据POST GET方法跳转

location ~ /server/ {
    proxy_pass_header   Server;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header    X-Scheme $scheme;
    if ($request_method ~* GET) {
                proxy_pass http://127.0.0.1:8080;
            }
    if ($request_method ~* POST) {
                proxy_pass http://127.0.0.1:8081;
            }
}

原文地址:https://www.cnblogs.com/cainiaoit/p/8607869.html