-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23f8ab9
commit 50c40c5
Showing
1 changed file
with
27 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,33 @@ | ||
# Charset | ||
charset utf-8; | ||
|
||
# PHP-FPM monitoring | ||
location ~ ^/_php-fpm/(status|ping)$ { | ||
access_log off; | ||
log_not_found off; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_pass php_fpm; | ||
} | ||
# favicon.ico and robots.txt | ||
location = /favicon.ico { log_not_found off; access_log off; } | ||
location = /robots.txt { log_not_found off; access_log off; } | ||
|
||
# Some basic cache-control for static files to be sent to the browser | ||
location ~* \.(?:ico|css|js|gif|jpeg|jpg|png)$ { | ||
expires max; | ||
add_header Pragma public; | ||
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | ||
} | ||
# PHP-FPM monitoring | ||
location ~ ^/_php-fpm/(status|ping)$ { | ||
access_log off; | ||
log_not_found off; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_pass php_fpm; | ||
} | ||
|
||
# Deny hidden files (.htaccess, .htpasswd, .DS_Store). | ||
location ~ /\. { | ||
deny all; | ||
access_log off; | ||
log_not_found off; | ||
} | ||
# PHP rules | ||
location / { | ||
try_files $uri $uri/ /index.php$is_args$args; | ||
} | ||
|
||
location / { | ||
try_files $uri $uri/ /index.php$is_args$args; | ||
} | ||
location ~ \.php$ { | ||
try_files $uri =404; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_pass php_fpm; | ||
} | ||
|
||
location ~ .*\.php$ { | ||
try_files $uri =404; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_pass php_fpm; | ||
} | ||
error_page 404 /index.php; | ||
|
||
# support folder redirects with and without trailing slashes | ||
location ~ "^(.*)[^/]$" { | ||
if (-d $document_root$uri) { | ||
rewrite ^ $redirect_scheme://$http_host$uri/ permanent; | ||
} | ||
} | ||
location ~ /\.ht { | ||
deny all; | ||
} |