config changes

This commit is contained in:
saiminh 2026-01-08 18:37:31 +13:00
parent f4ce1b860f
commit 6f4a61855f
2 changed files with 74 additions and 8 deletions

View file

@ -98,10 +98,53 @@ Then uncomment the HTTPS server block in your nginx config and reload.
## Troubleshooting ## Troubleshooting
### ERR_CONNECTION_REFUSED Errors
If you see `ERR_CONNECTION_REFUSED` errors for `/_app/immutable/` assets:
1. **Check if PM2 is running:**
```bash
pm2 list
```
If `floter-design` is not running or shows as `errored`, check logs:
```bash
pm2 logs floter-design --lines 50
```
2. **Test if Node.js server responds:**
```bash
curl http://localhost:3001
```
If this fails, the Node.js server isn't running.
3. **Check if port 3001 is in use:**
```bash
sudo netstat -tlnp | grep 3001
# or
sudo ss -tlnp | grep 3001
```
4. **Try running the server directly to see errors:**
```bash
cd ~/floter-design
node build/index.js
```
This will show any startup errors.
5. **Rebuild and restart:**
```bash
cd ~/floter-design
npm run build
pm2 restart floter-design
```
### Other Common Issues
- **Port already in use**: Change the PORT in `ecosystem.config.cjs` (default is 3001) or stop the process using that port - **Port already in use**: Change the PORT in `ecosystem.config.cjs` (default is 3001) or stop the process using that port
- **Port 3001 conflicts**: You can use any available port (3002, 3003, etc.) - just update both `ecosystem.config.cjs` and your nginx config - **Port 3001 conflicts**: You can use any available port (3002, 3003, etc.) - just update both `ecosystem.config.cjs` and your nginx config
- **502 Bad Gateway**: Check if the Node.js server is running (`pm2 list`) and check logs (`pm2 logs`) - **502 Bad Gateway**: Check if the Node.js server is running (`pm2 list`) and check logs (`pm2 logs`)
- **Permission errors**: Make sure the user running PM2 has proper permissions to the `/floter-design` directory - **Permission errors**: Make sure the user running PM2 has proper permissions to the `~/floter-design` directory
- **Missing dependencies**: Run `npm install` in `~/floter-design` before building
## Environment Variables ## Environment Variables

View file

@ -13,16 +13,13 @@ server {
listen [::]:80; listen [::]:80;
server_name _; # '_' catches all requests, or use your IP address like: 123.45.67.89 server_name _; # '_' catches all requests, or use your IP address like: 123.45.67.89
# OPTION 2: Using domain name (uncomment this and comment out OPTION 1 when you have a domain) # DO NOT set root directive - we're proxying everything to Node.js
# server { # root /var/www/html; # REMOVE THIS if it exists
# 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) # Redirect HTTP to HTTPS (uncomment after setting up SSL)
# return 301 https://$server_name$request_uri; # return 301 https://$server_name$request_uri;
# For now, proxy directly to Node.js (remove this block after SSL setup) # Proxy ALL requests (including assets) to Node.js server
location / { location / {
proxy_pass http://localhost:3001; proxy_pass http://localhost:3001;
proxy_http_version 1.1; proxy_http_version 1.1;
@ -38,9 +35,35 @@ server {
proxy_connect_timeout 60s; proxy_connect_timeout 60s;
proxy_send_timeout 60s; proxy_send_timeout 60s;
proxy_read_timeout 60s; proxy_read_timeout 60s;
# Ensure all paths are passed through correctly
proxy_redirect off;
} }
} }
# OPTION 2: Using domain name (uncomment this and comment out OPTION 1 when you have a domain)
# server {
# listen 80;
# listen [::]:80;
# server_name your-domain.com www.your-domain.com; # Replace with your domain
#
# 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;
# }
# }
# When you get a domain, you can add HTTPS configuration below: # When you get a domain, you can add HTTPS configuration below:
# HTTPS configuration (uncomment and configure after SSL certificate setup) # HTTPS configuration (uncomment and configure after SSL certificate setup)
# server { # server {