41 lines
1.4 KiB
Plaintext
41 lines
1.4 KiB
Plaintext
# /etc/nginx/sites-available/egorin.r.servaki.online.conf (gate 5.101.118.232)
|
|
# HTTP-first. certbot --nginx -d egorin.r.servaki.online довыпустит серт и добавит 443.
|
|
# Рядом с панелью «Ворота» (другой server_name) — её не трогает.
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name egorin.r.servaki.online;
|
|
|
|
root /var/www/egorin.r.servaki.online;
|
|
index index.html;
|
|
|
|
# SPA
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
location /assets/ {
|
|
expires 30d;
|
|
add_header Cache-Control "public, immutable";
|
|
try_files $uri =404;
|
|
}
|
|
# Бэкенд-шлюз (Yandex OAuth + данные) на 127.0.0.1:4100
|
|
location /api/ {
|
|
proxy_pass http://127.0.0.1:4100;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
location /socket {
|
|
proxy_pass http://127.0.0.1:4100;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
}
|
|
|
|
gzip on;
|
|
gzip_types text/css application/javascript application/json image/svg+xml;
|
|
access_log /var/log/nginx/egorin.access.log;
|
|
error_log /var/log/nginx/egorin.error.log;
|
|
}
|