Files
bendtstudio0-static/nginx.template.conf
Tim Bendt 772f2199b7 fix mime types
asked gemini pro 3
2025-11-29 23:47:45 -05:00

71 lines
1.8 KiB
Plaintext

worker_processes 5;
daemon off;
events {
worker_connections 4096;
}
http {
# Include standard MIME types
include $!{nginx}/conf/mime.types;
# Set default type
default_type application/octet-stream;
# Logging
access_log /dev/stdout;
error_log /dev/stdout;
# Optimization
sendfile on;
tcp_nopush on;
server_names_hash_bucket_size 128;
server {
listen ${PORT};
listen [::]:${PORT};
server_name localhost;
# Set the root to the app directory
root /app;
# KEY FIX: Add index.html to the index directive so the root loads
index index.html index.php;
charset utf-8;
# Root location for the static landing page
location / {
# Try to serve the file directly, then the directory, then 404
try_files $uri $uri/ =404;
}
# Pancake App Logic
# No 'alias' needed for static assets because they live in /app/pancake/third_party
# which matches the URI structure relative to root /app
location /pancake {
try_files $uri $uri/ @pancake_fallback;
}
location @pancake_fallback {
rewrite ^ /pancake/index.php last;
}
# PHP Processing
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include $!{nginx}/conf/fastcgi_params;
# fastcgi.conf often duplicates params but is safer to include if available
include $!{nginx}/conf/fastcgi.conf;
}
# Security: Deny hidden files
location ~ /\. {
deny all;
}
}
}