# ======================================================== # JPCHX Club Shield Nginx Configuration # ======================================================== # 1. Порт 80: Let's Encrypt ACME Challenge + Редирект на HTTPS server { listen 80; server_name _; location /.well-known/acme-challenge/ { root /var/www/certbot; } location / { return 301 https://$host$request_uri; } } # 2. Порт 8080: Внутренний HTTP Fallback для Xray server { listen 8080 default_server; server_name _; client_max_body_size 16M; location /static/ { alias /usr/share/nginx/html/static/; expires 7d; add_header Cache-Control "public, no-transform"; } location ~ ^/api/v1/recipes/secret_([a-zA-Z0-9_]+)/(.*)$ { resolver 127.0.0.11 valid=10s; proxy_pass http://3x-ui:2096/sub/$2; 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 https; proxy_connect_timeout 5s; proxy_read_timeout 15s; } location / { proxy_pass http://jpchx-app:8080; 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 https; proxy_connect_timeout 5s; proxy_read_timeout 30s; } } # 3. Порт 8443: Защищенный HTTPS Fallback для Reality SNI server { listen 8443 ssl default_server; server_name jpchx.matrixhasyou.ru; ssl_certificate /etc/letsencrypt/live/jpchx.matrixhasyou.ru/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/jpchx.matrixhasyou.ru/privkey.pem; ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers HIGH:!aNULL:!MD5; client_max_body_size 16M; location /static/ { alias /usr/share/nginx/html/static/; expires 7d; add_header Cache-Control "public, no-transform"; } location ~ ^/api/v1/recipes/secret_([a-zA-Z0-9_]+)/(.*)$ { resolver 127.0.0.11 valid=10s; proxy_pass http://3x-ui:2096/sub/$2; 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 https; proxy_connect_timeout 5s; proxy_read_timeout 15s; } location / { proxy_pass http://jpchx-app:8080; 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 https; proxy_connect_timeout 5s; proxy_read_timeout 30s; } }