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;
}
}