Created
May 16, 2014 09:10
-
-
Save steinkel/a3618fb9fc767391d46c to your computer and use it in GitHub Desktop.
getsimple cms nginx config file
This file contains hidden or 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
server { | |
listen 80; ## listen for ipv4; this line is default and implied | |
root /var/virtual/www | |
index index.php; | |
server_name example.com; | |
charset utf-8; | |
access_log off; | |
location / { | |
try_files $uri $uri/ /index.php?id=$uri&$args; | |
} | |
location ~* /admin/.*\.php$ { | |
try_files $uri /admin/index.php?id=$uri&$args; | |
include php.conf; | |
#auth_basic "Restricted"; ## optional httpassword protection for /admin | |
#auth_basic_user_file /var/virtual/.htpasswd; | |
} | |
location ~* \.php$ { | |
include php.conf; | |
try_files $uri =404; | |
#expires 2h; | |
} | |
location ~* \.(?:ico|js|gif|jpg|png)$ { | |
#expires 14d; | |
} | |
location ~* \.(htm|css|html)$ { | |
#expires 2d; | |
} | |
# this blocks direct access to the XML files (but sitemap.xml) - that hold all the data | |
location ~* \.xml$ { deny all; } | |
location ~* \.xml\.bak$ { deny all; } | |
location = /sitemap.xml { allow all; } | |
# this prevents hidden files (beginning with a period) from being served | |
location ~ /\. { deny all; } | |
location ^~ /uploads/ { | |
if ($request_uri ~* \.php$) {return 403;} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment