ai 'chat' is helping now
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m9s

This commit is contained in:
2025-12-01 22:18:11 -08:00
parent 337b3272ee
commit de18e9da02
2 changed files with 41 additions and 2 deletions

View File

@@ -1,6 +1,9 @@
server {
# Listen on port 80 for incoming HTTP requests.
# Allow large file uploads (e.g., for flyers). This must be set here to prevent Nginx from rejecting large requests before they reach the Node.js backend.
client_max_body_size 100M;
# The root directory where your built application files are located.
# This matches the destination in your rsync command.
root /var/www/flyer-crawler.projectium.com;
@@ -11,6 +14,12 @@ server {
# The domain name this configuration applies to.
server_name flyer-crawler.projectium.com;
# Deny access to all dotfiles
location ~ /\. {
deny all;
return 404;
}
location / {
# This is the crucial part for a Single-Page Application (SPA).
# 1. It first tries to serve the requested file ($uri).
@@ -24,6 +33,13 @@ server {
# It tells Nginx that any request starting with /api/ should be
# forwarded to your Node.js server running on port 3001.
location /api/ {
# Increase timeouts for long-running API requests, like AI processing.
# The default is 60s, which is often too short for AI image analysis.
# We'll set it to 300s (5 minutes) to be safe.
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
# The trailing slash on the proxy_pass URL is crucial.
# It tells Nginx to strip the `/api/` prefix from the request URI
# before passing it to the backend server.
@@ -55,8 +71,8 @@ server {
ssl_certificate_key /etc/letsencrypt/live/flyer-crawler.projectium.com/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 = flyer-crawler.projectium.com) {
return 301 https://$host$request_uri;
@@ -67,4 +83,6 @@ server {
listen [::]:80;
server_name flyer-crawler.projectium.com;
return 404; # managed by Certbot
}