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>
This commit is contained in:
2026-03-17 01:35:40 +03:00
parent a66c1f6035
commit efa1f1aeef
2 changed files with 67 additions and 41 deletions

View File

@@ -51,6 +51,9 @@ jobs:
hotelsync-cp:latest hotelsync-cp:latest
echo "✅ CP started" echo "✅ CP started"
- name: Sync nginx config
run: cp /opt/hotelsync/app/deploy/nginx/conf.d/hotelsync.conf /opt/hotelsync/nginx/conf.d/hotelsync.conf
- name: Reload nginx - name: Reload nginx
run: docker exec hotelsync-nginx nginx -s reload run: docker exec hotelsync-nginx nginx -s reload

View File

@@ -1,26 +1,8 @@
# ── Adminer — DB Web UI (port 8080, password protected) ───────────────────
server {
listen 8080;
server_name _;
auth_basic "HotelSync Database Admin";
auth_basic_user_file /etc/nginx/.htpasswd;
location / {
proxy_pass http://adminer: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_read_timeout 300;
}
}
# ── Редирект HTTP → HTTPS ───────────────────────────────────────────────── # ── Редирект HTTP → HTTPS ─────────────────────────────────────────────────
server { server {
listen 80; listen 80;
server_name hotelsync.ru www.hotelsync.ru app.hotelsync.ru api.hotelsync.ru git.hotelsync.ru cp.hotelsync.ru; server_name hotelsync.ru www.hotelsync.ru app.hotelsync.ru api.hotelsync.ru git.hotelsync.ru guest.hotelsync.ru cp.hotelsync.ru;
# Certbot challenge
location /.well-known/acme-challenge/ { location /.well-known/acme-challenge/ {
root /var/www/certbot; root /var/www/certbot;
} }
@@ -41,7 +23,7 @@ server {
ssl_ciphers HIGH:!aNULL:!MD5; ssl_ciphers HIGH:!aNULL:!MD5;
location / { location / {
proxy_pass http://frontend:80; proxy_pass http://hotelsync-frontend:80;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -49,7 +31,26 @@ server {
} }
} }
# ── hotelsync.ru — Лендинг (редирект на app пока нет лендинга) ─────────── # ── 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 { server {
listen 443 ssl; listen 443 ssl;
server_name hotelsync.ru www.hotelsync.ru; server_name hotelsync.ru www.hotelsync.ru;
@@ -59,27 +60,11 @@ server {
ssl_protocols TLSv1.2 TLSv1.3; ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5; ssl_ciphers HIGH:!aNULL:!MD5;
location / { root /var/www/landing;
return 302 https://app.hotelsync.ru; index index.html;
}
}
# ── 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 / { location / {
proxy_pass http://cp:80; try_files $uri $uri/ /index.html;
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;
} }
} }
@@ -94,7 +79,45 @@ server {
ssl_ciphers HIGH:!aNULL:!MD5; ssl_ciphers HIGH:!aNULL:!MD5;
location / { location / {
proxy_pass http://api:3000; 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 Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;