Skip to content

Add VPS deployment config for regpe.com (Nginx + deploy script)#3

Draft
bfricano wants to merge 1 commit into
masterfrom
claude/trader-resilience-platform-0w0igw
Draft

Add VPS deployment config for regpe.com (Nginx + deploy script)#3
bfricano wants to merge 1 commit into
masterfrom
claude/trader-resilience-platform-0w0igw

Conversation

@bfricano

Copy link
Copy Markdown
Owner

Summary

  • nginx.conf — production Nginx server block for regpe.com:

    • HTTP → HTTPS redirect
    • SSL via Let's Encrypt (Certbot paths pre-wired)
    • Security headers (HSTS, X-Frame-Options, X-Content-Type-Options, etc.)
    • PHP 8.4-FPM socket routing with 60s timeout for analytics endpoints
    • Static asset caching (1 year, immutable)
    • SQLite data/ directory locked down (403)
  • deploy.sh — one-command setup for Ubuntu 22.04/24.04:

    • install — installs Nginx, PHP 8.4-FPM + extensions, SQLite, Certbot; clones repo; provisions SSL cert; sets data/ permissions; configures OPcache and log rotation
    • updategit pull + reload PHP-FPM and Nginx; use for every subsequent deploy

Usage on the server

# First-time setup (run as root on the VPS):
curl -sO https://raw.githubusercontent.com/bfricano/sample-code-php/master/TraderResiliencePlatform/deploy.sh
sudo bash deploy.sh install

# All future deploys:
sudo bash deploy.sh update

Test plan

  • Point regpe.com A record to server IP before running install
  • install completes without errors; https://regpe.com loads the platform
  • HTTP → HTTPS redirect works (curl -I http://regpe.com)
  • data/ is not accessible via browser (curl https://regpe.com/data/ returns 404)
  • update pulls latest and reloads without downtime

🤖 Generated with Claude Code

https://claude.ai/code/session_01Co9XijEtZ2NA1q84rRCCLk


Generated by Claude Code

nginx.conf: Nginx server block for regpe.com with HTTPS redirect,
  SSL (Let's Encrypt), security headers, PHP-FPM socket routing,
  static asset caching, and SQLite data-dir lockdown

deploy.sh: one-command setup on Ubuntu 22.04/24.04
  - install: installs Nginx, PHP 8.4-FPM, SQLite, Certbot, clones repo,
    provisions SSL, sets permissions, configures log rotation
  - update: git pull + reload — use for all subsequent deploys

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Co9XijEtZ2NA1q84rRCCLk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants