Files
hotelsync/deploy/nginx/conf.d/hotelsync.conf
HotelSync efa1f1aeef Fix nginx config: cp.hotelsync.ru routes to hotelsync-cp container
The actual nginx config lives at /opt/hotelsync/nginx/conf.d/ (outside git).
It used container names (hotelsync-*) not docker-compose service aliases.
- cp.hotelsync.ru: hotelsync-frontend:80 → hotelsync-cp:80
- app/guest: restored hotelsync-frontend:80 (was broken by accidental sed)
- deploy.yml: added step to sync this file from repo to /opt/hotelsync/nginx/conf.d/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 01:35:40 +03:00

127 lines
4.7 KiB
Plaintext

# ── Редирект HTTP → HTTPS ─────────────────────────────────────────────────
server {
listen 80;
server_name hotelsync.ru www.hotelsync.ru app.hotelsync.ru api.hotelsync.ru git.hotelsync.ru guest.hotelsync.ru cp.hotelsync.ru;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://$host$request_uri;
}
}
# ── app.hotelsync.ru — Панель управления (React SPA) ─────────────────────
server {
listen 443 ssl;
server_name app.hotelsync.ru;
ssl_certificate /etc/letsencrypt/live/app.hotelsync.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/app.hotelsync.ru/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_pass http://hotelsync-frontend:80;
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;
}
}
# ── guest.hotelsync.ru — Гостевой портал ─────────────────────────────────
server {
listen 443 ssl;
server_name guest.hotelsync.ru;
ssl_certificate /etc/letsencrypt/live/guest.hotelsync.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/guest.hotelsync.ru/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_pass http://hotelsync-frontend:80;
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;
}
}
# ── hotelsync.ru — Лендинг ────────────────────────────────────────────────
server {
listen 443 ssl;
server_name hotelsync.ru www.hotelsync.ru;
ssl_certificate /etc/letsencrypt/live/hotelsync.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/hotelsync.ru/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
root /var/www/landing;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
# ── api.hotelsync.ru — API Backend ────────────────────────────────────────
server {
listen 443 ssl;
server_name api.hotelsync.ru;
ssl_certificate /etc/letsencrypt/live/api.hotelsync.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/api.hotelsync.ru/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_pass http://hotelsync-api:3000;
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;
}
}
# ── cp.hotelsync.ru — Control Panel ──────────────────────────────────────
server {
listen 443 ssl;
server_name cp.hotelsync.ru;
ssl_certificate /etc/letsencrypt/live/cp.hotelsync.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/cp.hotelsync.ru/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_pass http://hotelsync-cp:80;
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;
}
}
# ── git.hotelsync.ru — Gitea ──────────────────────────────────────────────
server {
listen 443 ssl;
server_name git.hotelsync.ru;
ssl_certificate /etc/letsencrypt/live/git.hotelsync.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/git.hotelsync.ru/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_pass http://hotelsync-gitea:3000;
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;
}
}