mirror of
https://github.com/luzifer-docker/alpine-nginx-php.git
synced 2024-12-21 03:31:17 +00:00
40 lines
932 B
Text
Executable file
40 lines
932 B
Text
Executable file
server {
|
|
listen 80;
|
|
listen [::]:80 default ipv6only=on;
|
|
|
|
root /var/www;
|
|
index index.php;
|
|
|
|
# Disable sendfile as per https://docs.vagrantup.com/v2/synced-folders/virtualbox.html
|
|
sendfile off;
|
|
|
|
# Add stdout logging
|
|
|
|
error_log /dev/stdout info;
|
|
access_log /dev/stdout;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.php$is_args$args;
|
|
}
|
|
|
|
location ~ \.php$ {
|
|
try_files $uri =404;
|
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
|
fastcgi_pass unix:/var/run/php-fpm.sock;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
|
|
fastcgi_index index.php;
|
|
include fastcgi_params;
|
|
}
|
|
|
|
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
|
|
expires 5d;
|
|
}
|
|
|
|
# deny access to . files, for security
|
|
#
|
|
location ~ /\. {
|
|
log_not_found off;
|
|
deny all;
|
|
}
|
|
}
|