guidly/deploy/nginx-guidly.conf
laruevin d5ed7fdcf9 Initial commit: Guidly project with CI/CD pipeline
Telegram Bot + Mini App for city walking quests.
- React 19 + TypeScript + Vite 6 frontend
- Express 5 + PostgreSQL backend
- grammY Telegram bot with DeepSeek AI
- GitLab CI/CD: lint, build, deploy to production

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:42:42 +07:00

44 lines
1.3 KiB
Plaintext

server {
listen 80;
server_name gidli.ru;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name gidli.ru;
# SSL certificates (managed by certbot)
ssl_certificate /etc/letsencrypt/live/gidli.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/gidli.ru/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
# Security headers
add_header X-Frame-Allow "tg-embed";
add_header X-Content-Type-Options nosniff;
# Proxy API and webhook requests to Express
location /api/ {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
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;
proxy_read_timeout 120s;
}
# Serve static files (Vite build output)
location / {
root /root/guidly/dist;
try_files $uri $uri/ /index.html;
# Cache static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
expires 30d;
add_header Cache-Control "public, immutable";
}
}
}