72 lines
1.5 KiB
Nginx Configuration File
72 lines
1.5 KiB
Nginx Configuration File
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=STATIC:10m inactive=7d use_temp_path=off;
|
|
|
|
upstream backend
|
|
{
|
|
server unix:/app/run/socket0.sock;
|
|
server unix:/app/run/socket1.sock;
|
|
server unix:/app/run/socket2.sock;
|
|
server unix:/app/run/socket3.sock;
|
|
}
|
|
|
|
upstream frontend
|
|
{
|
|
server front:3000;
|
|
}
|
|
|
|
server
|
|
{
|
|
listen 80; # managed by Certbot
|
|
|
|
server_name crm.logidex.ru www.crm.logidex.ru;
|
|
gzip on;
|
|
gzip_proxied any;
|
|
gzip_comp_level 4;
|
|
gzip_types text/css application/javascript image/svg+xml application/json text/plain text/xml;
|
|
|
|
|
|
# Общие proxy_set_header, унаследованные всеми location
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header Host $host;
|
|
|
|
|
|
location /api
|
|
{
|
|
proxy_pass http://backend;
|
|
}
|
|
|
|
location /
|
|
{
|
|
proxy_pass http://frontend;
|
|
}
|
|
|
|
location /_next/webpack-hmr
|
|
{
|
|
proxy_pass http://frontend;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
}
|
|
|
|
location /_next/static
|
|
{
|
|
proxy_cache STATIC;
|
|
proxy_pass http://frontend;
|
|
add_header X-Cache-Status $upstream_cache_status;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
proxy_cache_bypass $http_upgrade;
|
|
}
|
|
|
|
location /static
|
|
{
|
|
proxy_cache STATIC;
|
|
proxy_ignore_headers Cache-Control;
|
|
proxy_cache_valid 60m;
|
|
proxy_pass http://frontend;
|
|
}
|
|
}
|
|
|