Created
August 1, 2015 00:35
-
-
Save shoaibali/c8b687615d0bf00ba589 to your computer and use it in GitHub Desktop.
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
fastcgi_buffers 16 16k; | |
fastcgi_buffer_size 32k; | |
server { | |
listen 80; | |
listen 127.0.0.1:443 ssl; | |
root /sites/deploynaut/www; | |
server_name mgmt 127.0.0.1; | |
# Self signed certificates generated by the ssl-cert package | |
# Don't use them in a production server! | |
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem; | |
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key; | |
# Defend against SS-2015-013 -- http://www.silverstripe.org/software/download/security-releases/ss-2015-013 | |
if ($http_x_forwarded_host) { | |
return 400; | |
} | |
location / { | |
try_files $uri /framework/main.php?url=$uri&$query_string; | |
} | |
error_page 404 /assets/error-404.html; | |
error_page 500 /assets/error-500.html; | |
location ^~ /assets/ { | |
sendfile on; | |
try_files $uri =404; | |
} | |
location ~ /framework/.*(main|rpc|tiny_mce_gzip)\.php$ { | |
fastcgi_keep_conn on; | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
location ~ /(mysite|framework|cms)/.*\.(php|php3|php4|php5|phtml|inc)$ { | |
deny all; | |
} | |
location ~ /\.. { | |
deny all; | |
} | |
location ~ \.ss$ { | |
satisfy any; | |
allow 127.0.0.1; | |
deny all; | |
} | |
location ~ web\.config$ { | |
deny all; | |
} | |
location ~ \.ya?ml$ { | |
deny all; | |
} | |
location ^~ /vendor/ { | |
deny all; | |
} | |
location ~* /silverstripe-cache/ { | |
deny all; | |
} | |
location ~* composer\.(json|lock)$ { | |
deny all; | |
} | |
location ~* /(cms|framework)/silverstripe_version$ { | |
deny all; | |
} | |
location ~ \.php$ { | |
fastcgi_keep_conn on; | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
fastcgi_busy_buffers_size 64k; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment