BaotonDaiduong / nginx.conf
gaialive's picture
Update nginx.conf
753e8d4 verified
# A complete, minimal nginx.conf for restricted environments like Hugging Face Spaces
# Set a writable PID path.
pid /tmp/nginx.pid;
# Run a single worker process.
worker_processes 1;
events {
worker_connections 1024;
}
http {
# Log errors and access to stdout/stderr to avoid file permission issues.
# This is the correct context for these directives.
error_log /dev/stderr warn;
access_log /dev/stdout;
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 8080;
server_name localhost;
# Set temporary paths to a writable directory
client_body_temp_path /tmp/client_temp;
proxy_temp_path /tmp/proxy_temp;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}