nginx inside the Docker container defaults to 1MB body limit — base64 image payloads exceed this and return a 413 HTML page, causing the "Unexpected token '<'" JSON parse error on video_api.php. Gemini 429 rate limit errors on prompt optimization now fall back silently instead of surfacing an error to the user. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
45 lines
1.3 KiB
Nginx Configuration File
45 lines
1.3 KiB
Nginx Configuration File
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
sendfile on;
|
|
client_max_body_size 100M;
|
|
|
|
server {
|
|
listen 80;
|
|
root /var/www/html;
|
|
|
|
# Block sensitive backend files
|
|
location ~ ^/lux-studio/api/(\.env|composer\.|vendor/|\.htaccess|\.git) {
|
|
return 404;
|
|
}
|
|
|
|
# Block uploads dir — served only via stream_video.php
|
|
location ^~ /lux-studio/api/uploads/ {
|
|
return 403;
|
|
}
|
|
|
|
# Block internal-only PHP classes
|
|
location ~ ^/lux-studio/api/(AuthMiddleware|JWTValidator|session_manager|env_loader|config)\.php$ {
|
|
return 403;
|
|
}
|
|
|
|
# PHP API — pass to php-fpm
|
|
location ~ ^/lux-studio/api/(.+\.php)$ {
|
|
fastcgi_pass 127.0.0.1:9000;
|
|
fastcgi_index index.php;
|
|
include fastcgi_params;
|
|
fastcgi_param SCRIPT_FILENAME /var/www/html/lux-studio/api/$1;
|
|
fastcgi_param DOCUMENT_ROOT /var/www/html/lux-studio/api;
|
|
fastcgi_read_timeout 300;
|
|
}
|
|
|
|
# Frontend SPA — fallback to index.html for React Router
|
|
location /lux-studio/ {
|
|
try_files $uri $uri/ /lux-studio/index.html;
|
|
}
|
|
}
|
|
}
|