Hello,
Could the Unhandled Runtime Errors
error be related to Nginx configuration or directory permissions?
The Nginx configuration is:
server {
listen 80;
server_name localhost 127.0.0.1;
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
location / {
# Don't process /branch requests here
location /branch {
# We'll handle this in the next section
}
location ~* ^/(\.git|\.env|\.svn|\.ht|wp-config\.php|boaform|admin|actuator) {
deny all;
return 404;
}
# Main proxy for root app
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
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;
proxy_buffering off;
proxy_request_buffering off;
}
# Static files for first app
location /_next/static {
proxy_pass http://127.0.0.1:3000/_next/static;
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;
expires 1y;
add_header Cache-Control "public, immutable, max-age=31536000";
}
# =====================
# Shared Backend API (Port 9000)
# =====================
location /api {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/public/index.php;
include fastcgi_params;
# Cache configuration
fastcgi_cache PHP_CACHE;
fastcgi_cache_valid 200 301 302 10m;
fastcgi_cache_methods GET HEAD;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_min_uses 1;
add_header X-Cache-Status $upstream_cache_status;
# Headers
fastcgi_param HTTP_HOST $host;
fastcgi_param X-Real-IP $remote_addr;
fastcgi_param X-Forwarded-For $proxy_add_x_forwarded_for;
# CORS
add_header 'Access-Control-Allow-Origin' $cors_origin always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type, Authorization' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
if ($request_method = 'OPTIONS') {
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
}
# =====================
# Error Handling
# =====================
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /404.html {
internal;
root /usr/share/nginx/html;
}
location = /50x.html {
internal;
root /usr/share/nginx/html;
}
}
After opening a few pages, the following error is displayed:
What is your opinion?
Thank you.