-
Notifications
You must be signed in to change notification settings - Fork 3
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
Soifou
committed
Nov 23, 2017
1 parent
8222b16
commit aa29c23
Showing
1 changed file
with
29 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
index index.php index.html | ||
|
||
## Begin - Index | ||
# for subfolders, simply adjust: | ||
# `location /subfolder {` | ||
# and the rewrite to use `/subfolder/index.php` | ||
location / { | ||
try_files $uri $uri/ /index.php?_url=$uri&$query_string; | ||
} | ||
## End - Index | ||
|
||
## Begin - Security | ||
# deny all direct access for these folders | ||
location ~* /(\.git|cache|bin|logs|backup|tests)/.*$ { return 403; } | ||
# deny running scripts inside core system folders | ||
location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ { return 403; } | ||
# deny running scripts inside user folder | ||
location ~* /user/.*\.(txt|md|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ { return 403; } | ||
# deny access to specific files in the root folder | ||
location ~ /(LICENSE\.txt|composer\.lock|composer\.json|nginx\.conf|web\.config|htaccess\.txt|\.htaccess) { return 403; } | ||
## End - Security | ||
|
||
location ~ \.php$ { | ||
fastcgi_pass php:9000; | ||
fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
fastcgi_index index.php; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; | ||
} |