server { server_name www.intelaide.ai intelaide.ai; # Reverse proxy for development code location /dev/ { # Remove the /dev prefix before passing to the dev server proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600; } # Reverse proxy for production code location / { proxy_pass http://localhost:5002; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600; } # Serve static HTML files for /llocal/ requests location /llocal/ { alias /var/www/html/; index index.html index.htm; try_files $uri $uri/ =404; } error_page 502 /custom_502.html; location = /custom_502.html { root /usr/share/nginx/html; # adjust this path as needed internal; } listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/www.intelaide.ai/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/www.intelaide.ai/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot } server { if ($host = intelaide.ai) { return 301 https://$host$request_uri; } # managed by Certbot if ($host = www.intelaide.ai) { return 301 https://$host$request_uri; } # managed by Certbot server_name www.intelaide.ai intelaide.ai; listen 80; return 404; # managed by Certbot }