upstream backend {
# Тут можете установить адреса всех бэкендов
server 127.0.0.1:7800;
}
server {
listen 80;
server_name www.test.ru test.ru;
#####################################
# GZIP
#####################################
gzip on;
gzip_vary on;
gzip_disable "MSIE [4-6]\.";
gzip_types text/plain
text/css
application/json
application/x-javascript
text/xml
application/xml
application/xml+rss
text/javascript
application/javascript;
#####################################
# Locations
#####################################
# Static
location /public {
# Trust Proxy
add_header Host $host;
add_header X-Real-IP $remote_addr;
add_header X-Forwarded-For $proxy_add_x_forwarded_for;
expires 30d;
root /apps/test.ru/;
}
# Proxy
location / {
# Trust Proxy
add_header Host $host;
add_header X-Real-IP $remote_addr;
add_header X-Forwarded-For $proxy_add_x_forwarded_for;
# expires 3m;
proxy_pass http://backend;
}
}