mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Remove module blacklist
- It's not necessary, as SilverStripe returns a not-found page when an attempt is made to retrieve a file directly from a module. - Also format as a fenced code block and style as nginx.
This commit is contained in:
parent
de25c93b75
commit
8f91f35526
@ -18,6 +18,7 @@ Especially be aware of [accidental php-execution](https://nealpoole.com/blog/201
|
|||||||
|
|
||||||
But enough of the disclaimer, on to the actual configuration — typically in `nginx.conf`:
|
But enough of the disclaimer, on to the actual configuration — typically in `nginx.conf`:
|
||||||
|
|
||||||
|
```nginx
|
||||||
server {
|
server {
|
||||||
include mime.types;
|
include mime.types;
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
@ -54,17 +55,7 @@ But enough of the disclaimer, on to the actual configuration — typically in `n
|
|||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Core denial (change mysite if you use a different name)
|
# Denials
|
||||||
location ~ /(mysite|framework|cms)/.*\.(php|php3|php4|php5|phtml|inc)$ {
|
|
||||||
deny all;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Modules denial (edit the regex to match your installed modules)
|
|
||||||
location ~ /(buildtools|colorpicker|docsviewer|editlock|geoip|googlesitemaps|mathspamprotection|sortablegridfield|spamprotection|testsession|userforms)/.*\.(php|php3|php4|php5|phtml|inc)$ {
|
|
||||||
deny all;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Other denials
|
|
||||||
location ~ /\.. {
|
location ~ /\.. {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
@ -95,6 +86,7 @@ But enough of the disclaimer, on to the actual configuration — typically in `n
|
|||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
The above configuration sets up a virtual host `example.com` with
|
The above configuration sets up a virtual host `example.com` with
|
||||||
rewrite rules suited for SilverStripe. The location block for framework
|
rewrite rules suited for SilverStripe. The location block for framework
|
||||||
|
Loading…
x
Reference in New Issue
Block a user