Files
pyre/infra/nginx/feedthepyre.com.conf
RogueWave d159ad5196 feat(web+infra): polished front page, app at /, tracker at /status
- apps/web: redesigned landing (Hero/Scanner/HowItWorks/Features/Footer),
  honest live-vs-coming-soon badges, same-origin /api/scan, ember theme.
- ecosystem.config.cjs: runnable — pyre-api/worker via `node --import tsx`,
  pyre-web via `next start`, fork mode, env wired. pm2 web+api verified online
  (api /health 200, scan 200, web 200).
- infra/nginx/feedthepyre.com.conf: app at / (proxy :3000), API at /api
  (proxy :4000, prefix preserved), dev tracker at /status (static).
- scripts/deploy-web.sh: sudo cutover (install vhost, nginx -t, reload,
  certbot --nginx --keep-until-expiring).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 03:24:58 +00:00

64 lines
2.3 KiB
Plaintext

# =============================================================================
# nginx vhost — feedthepyre.com
# =============================================================================
# Serves the PYRE app at /, the API at /api, and the dev status tracker at
# /status. Installed to /etc/nginx/sites-available/feedthepyre.com by
# scripts/deploy-web.sh; certbot --nginx mirrors this server to a 443 block and
# adds the HTTP->HTTPS redirect.
#
# Upstreams (pm2): web = 127.0.0.1:3000 (Next.js), api = 127.0.0.1:4000 (Fastify)
# =============================================================================
server {
listen 80;
listen [::]:80;
server_name feedthepyre.com www.feedthepyre.com;
access_log /var/log/nginx/feedthepyre.access.log;
error_log /var/log/nginx/feedthepyre.error.log;
gzip on;
gzip_proxied any;
gzip_types text/plain text/css application/json application/javascript
application/xml image/svg+xml;
client_max_body_size 1m;
# Let's Encrypt HTTP-01 (kept so cert renewals work).
location ^~ /.well-known/acme-challenge/ {
root /var/www/feedthepyre/status;
allow all;
}
# --- Dev status tracker (static) -> /status -----------------------------
location = /status { return 301 /status/; }
location /status/ {
alias /var/www/feedthepyre/status/;
index index.html;
try_files $uri $uri/ /status/index.html;
}
# --- API (Fastify) ------------------------------------------------------
# No trailing slash on proxy_pass: the /api/ prefix is preserved, so the
# backend receives /api/scan (its actual route).
location /api/ {
proxy_pass http://127.0.0.1:4000;
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 60s;
}
# --- Web app (Next.js) --------------------------------------------------
location / {
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;
}
}