Skip to content

Instantly share code, notes, and snippets.

@DELAGREEN
Created January 30, 2026 16:29
Show Gist options
  • Select an option

  • Save DELAGREEN/b7e83e467f126233a8735e046a88f446 to your computer and use it in GitHub Desktop.

Select an option

Save DELAGREEN/b7e83e467f126233a8735e046a88f446 to your computer and use it in GitHub Desktop.
server {
listen 80;
listen [::]:80;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name _;
# SSL сертификаты
ssl_certificate /etc/ssl/certs/localhost.crt;
ssl_certificate_key /etc/ssl/private/localhost.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
# Основной путь
location / {
proxy_pass http://localhost:22053; # Используем порт 22053
# Важные заголовки
proxy_set_header Host $host;
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 X-Forwarded-Host $host;
# Для WebSocket
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# Статические файлы
location /assets/ {
proxy_pass http://localhost:22053/assets/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
expires 1y;
add_header Cache-Control "public, immutable";
}
# Для Xray
location /xray {
proxy_pass http://localhost:22096;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment