47 lines
1.6 KiB
Text
47 lines
1.6 KiB
Text
# ========================================================
|
|
# Pelmeni 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 _;
|
|
|
|
# Корневой сайт: Клуб любителей сибирских пельменей
|
|
location / {
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# Секретный шлюз выдачи подписок 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;
|
|
}
|
|
|
|
# Защита от перебора: любая ошибка выдает главную страницу пельменей
|
|
error_page 404 /index.html;
|
|
error_page 500 502 503 504 /index.html;
|
|
}
|