42 lines
1.0 KiB
Nginx Configuration File
42 lines
1.0 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
# Document root - pas aan indien nodig (bijv. /var/www/html/public voor Laravel-style)
|
|
root /var/www/html/public;
|
|
index index.php index.html;
|
|
|
|
# Logging
|
|
error_log /var/log/nginx/error.log;
|
|
access_log /var/log/nginx/access.log;
|
|
|
|
# Max upload size
|
|
client_max_body_size 64M;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.php?$query_string;
|
|
}
|
|
|
|
location ~ \.php$ {
|
|
try_files $uri =404;
|
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
|
fastcgi_pass app:9000;
|
|
fastcgi_index index.php;
|
|
include fastcgi_params;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
fastcgi_buffering off;
|
|
}
|
|
|
|
# Deny .ht files
|
|
location ~ /\.ht {
|
|
deny all;
|
|
}
|
|
|
|
# Cache static files
|
|
location ~* \.(jpg|jpeg|png|gif|ico|css|js|woff|woff2)$ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
}
|