65 lines
2.3 KiB
Text
65 lines
2.3 KiB
Text
# Example nginx configuration for SvelteKit Node.js app
|
|
# Place this in: /etc/nginx/sites-available/floter-design
|
|
# Then create symlink: sudo ln -s /etc/nginx/sites-available/floter-design /etc/nginx/sites-enabled/
|
|
# Test config: sudo nginx -t
|
|
# Reload: sudo systemctl reload nginx
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name your-domain.com www.your-domain.com; # Replace with your domain
|
|
|
|
# Redirect HTTP to HTTPS (uncomment after setting up SSL)
|
|
# return 301 https://$server_name$request_uri;
|
|
|
|
# For now, proxy directly to Node.js (remove this block after SSL setup)
|
|
location / {
|
|
proxy_pass http://localhost:3001;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
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_cache_bypass $http_upgrade;
|
|
|
|
# Increase timeouts for long-running requests
|
|
proxy_connect_timeout 60s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
}
|
|
}
|
|
|
|
# HTTPS configuration (uncomment and configure after SSL certificate setup)
|
|
# server {
|
|
# listen 443 ssl http2;
|
|
# listen [::]:443 ssl http2;
|
|
# server_name your-domain.com www.your-domain.com;
|
|
#
|
|
# # SSL certificate paths (use Let's Encrypt or your certificate)
|
|
# ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
|
|
# ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;
|
|
#
|
|
# # SSL configuration
|
|
# ssl_protocols TLSv1.2 TLSv1.3;
|
|
# ssl_ciphers HIGH:!aNULL:!MD5;
|
|
# ssl_prefer_server_ciphers on;
|
|
#
|
|
# location / {
|
|
# proxy_pass http://localhost:3001;
|
|
# proxy_http_version 1.1;
|
|
# proxy_set_header Upgrade $http_upgrade;
|
|
# proxy_set_header Connection 'upgrade';
|
|
# 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_cache_bypass $http_upgrade;
|
|
#
|
|
# proxy_connect_timeout 60s;
|
|
# proxy_send_timeout 60s;
|
|
# proxy_read_timeout 60s;
|
|
# }
|
|
# }
|
|
|