server {
listen 80;
listen [::]:80;
server_name _;
root /opt/cherkizovo/frontend;
index index.html;
client_max_body_size 20m;
gzip on;
gzip_types text/css application/javascript application/json image/svg+xml;
gzip_min_length 1024;
location /api/ {
proxy_pass http://127.0.0.1:5000;
proxy_http_version 1.1;
# OAuth-callback и cookie-сессия портала: пробрасываем QueryString, Cookie и
# X-Forwarded-* без перехвата редиректов, чтобы схема/хост совпадали с RedirectUri.
proxy_intercept_errors off;
proxy_pass_request_headers on;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
}
location /health {
proxy_pass http://127.0.0.1:5000;
proxy_http_version 1.1;
proxy_set_header Host $host;
}
location /assets/ {
try_files $uri =404;
add_header Cache-Control "public, max-age=31536000, immutable";
}
location / {
try_files $uri $uri/ /index.html;
}
}