pelmeni-shield-vpn/nginx/conf.d/default.conf

56 lines
1.9 KiB
Text

# ========================================================
# 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: Внутренний Fallback для Xray (Сеть shield_net)
server {
listen 8080 default_server;
server_name _;
client_max_body_size 16M;
# Статические файлы сайта Клуба ЖПЧХ (CSS, галерея)
location /static/ {
alias /usr/share/nginx/html/static/;
expires 7d;
add_header Cache-Control "public, no-transform";
}
# Секретный шлюз выдачи подписок 3X-UI
# Маскируется под API клубных рецептов/архивов:
# URL: https://DOMAIN/api/v1/recipes/secret_TOKEN/SUB_ID
location ~ ^/api/v1/recipes/secret_([a-zA-Z0-9]+)/(.*)$ {
proxy_pass http://3x-ui:2053/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;
}
}