Предварительно, могу показать как оно проксируется, не знаю хватит ли этого:
http {
proxy_http_version 1.1;
proxy_redirect off;
proxy_intercept_errors on;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffering on;
proxy_buffer_size 64k;
proxy_buffers 128 128k;
proxy_busy_buffers_size 128k;
proxy_temp_file_write_size 128k;
proxy_ignore_headers Set-Cookie;
proxy_hide_header X-Powered-By;
proxy_ignore_client_abort on;
proxy_temp_path /var/tmp/nginx/vhosts_proxy_temp;
server {
...
location / {
try_files $uri @proxy_upstream;
}
location ~ \.php$ {
proxy_pass http://$httpd_upstream;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Server $server_addr;
proxy_set_header X-Url-Scheme $scheme;
}
location @proxy_upstream {
proxy_pass http://$httpd_upstream;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Server $server_addr;
proxy_set_header X-Url-Scheme $scheme;
}
}
map $remote_addr $httpd {
default httpd;
}
upstream httpd {
server backend-01-1:8081 max_fails=5;
server backend-01-2:8081 max_fails=5;
}
}