LaravelPublisher/docker/nginx/default.conf.template

38 lines
870 B
Plaintext

server {
listen ${NGINX_PORT};
server_name ${NGINX_HOST};
client_max_body_size 100M;
root /var/www/html/public;
index index.php index.html;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass app:9000;
fastcgi_index index.php;
# Laravel 正確位置
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# Optional: 支援 PATH_INFO
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
# 避免 NGINX 直接 cache
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
location ~ /\.ht {
deny all;
}
}