From 0284dbb48c02b656dac23db99564555d9dbdf9e8 Mon Sep 17 00:00:00 2001 From: jared Date: Sat, 24 Jan 2026 01:43:54 +0000 Subject: [PATCH] adding ia nginx --- ubuntu/ia/nginx/intelaide.ai | 68 ++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 ubuntu/ia/nginx/intelaide.ai diff --git a/ubuntu/ia/nginx/intelaide.ai b/ubuntu/ia/nginx/intelaide.ai new file mode 100644 index 0000000..d355c6d --- /dev/null +++ b/ubuntu/ia/nginx/intelaide.ai @@ -0,0 +1,68 @@ +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 +}