worker_processes auto; events { worker_connections 1024; multi_accept on; # Accept multiple connections at once } http { include mime.types; default_type application/octet-stream; # Optimize file transfers sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types { text/html html; text/css css; text/xml xml; image/gif gif; image/jpeg jpeg jpg; application/javascript js; application/json json; application/xml xml; application/rss+xml rss; text/plain txt; } # Improve performance and security gzip on; gzip_comp_level 6; # Compression level (1-9) gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/rss+xml; gzip_proxied any; gzip_vary on; gzip_disable "msie6"; # Disable gzip for older browsers server { listen 7860; # Use standard port 80 for HTTP server_name unicone-studio-portal.hf.space; # Replace with your actual domain root /usr/share/nginx/html; index index.html; location / { try_files $uri $uri/ /index.html; # Add caching headers for static assets expires 1d; add_header Cache-Control "public"; } # Handle 404 errors error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; internal; } # Handle 500 errors error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; internal; } # Deny access to sensitive files location ~ /\.(ht|git) { deny all; } } }