Commit Graph

2 Commits

Author SHA1 Message Date
a70ee08821 🔧 Fix static files serving in Nginx
CRITICAL FIX: Static files (CSS/JS) not loading after changing web:8000 to localhost:8000

Changes:
- nginx-smartsoltech.conf: Enabled /static/ and /media/ locations BEFORE location /
- NGINX_SETUP.md: Updated config to serve static files directly from filesystem
- NGINX_STATIC_FIX.md: Comprehensive troubleshooting guide for static files issues

Why this matters:
- Nginx must serve /static/ and /media/ DIRECTLY from filesystem (fast)
- NOT proxy to Django (slow)
- Order matters: location /static/ MUST be before location /
- Improves performance: 50-100ms → 1-5ms per static file request

Solution on server:
1. git pull origin master
2. sudo cp nginx-smartsoltech.conf /etc/nginx/sites-available/smartsoltech
3. sudo nginx -t && sudo systemctl reload nginx
2025-11-24 11:54:54 +09:00
b93ab4d796 🌐 Add Nginx configuration and setup scripts
- Added nginx-smartsoltech.conf: Ready-to-use Nginx config with SSL, proxy, security headers
- Added setup-nginx.sh: Automated Nginx setup script with symlink creation
- Added NGINX_SETUP.md: Comprehensive Nginx setup guide with troubleshooting
- Added NGINX_QUICK_SETUP.md: Quick reference cheatsheet

Features:
- HTTP to HTTPS redirect
- www to non-www redirect
- Proxy to Django (localhost:8000)
- SSL configuration (ready for Let's Encrypt)
- Security headers (HSTS, XSS, etc)
- Logging configuration
- Automated default removal and symlink creation
2025-11-24 11:49:52 +09:00