68 lines
1.9 KiB
Nginx Configuration File
68 lines
1.9 KiB
Nginx Configuration File
# Homebox AI Frontend - Nginx Configuration
|
|
#
|
|
# SETUP: Update the paths below to match your installation:
|
|
# 1. ssl_certificate / ssl_certificate_key - path to generated certs
|
|
# 2. root - path to frontend folder
|
|
#
|
|
# Run: sudo nginx -c /full/path/to/this/nginx.conf
|
|
|
|
worker_processes 1;
|
|
pid /tmp/nginx.pid;
|
|
error_log /tmp/nginx_error.log;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
sendfile on;
|
|
keepalive_timeout 65;
|
|
|
|
access_log /tmp/nginx_access.log;
|
|
|
|
# Increase max body size for image uploads
|
|
client_max_body_size 50M;
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name localhost;
|
|
|
|
# UPDATE THESE PATHS to your project location
|
|
ssl_certificate /home/mab122/devel/homebox_ai_frontend/nginx/certs/cert.pem;
|
|
ssl_certificate_key /home/mab122/devel/homebox_ai_frontend/nginx/certs/key.pem;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_ciphers HIGH:!aNULL:!MD5;
|
|
|
|
# Frontend static files - UPDATE THIS PATH
|
|
location / {
|
|
root /home/mab122/devel/homebox_ai_frontend/frontend;
|
|
index index.html;
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# Backend API proxy
|
|
location /api/ {
|
|
proxy_pass http://127.0.0.1:8000;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
|
|
# Timeout settings for slow AI responses
|
|
proxy_connect_timeout 60s;
|
|
proxy_send_timeout 120s;
|
|
proxy_read_timeout 120s;
|
|
}
|
|
}
|
|
|
|
# Redirect HTTP to HTTPS
|
|
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|