-
Notifications
You must be signed in to change notification settings - Fork 48
[HOW TO] Using Nginx with Phile
Schlaefer edited this page Mar 17, 2018
·
3 revisions
Use this if you plan to host Phile from http://yourdomain.com/ or the root of a subdomain.
An example Nginx config:
location / {
try_files $uri $uri/ /index.php$args;
}
Use this if you plan to host Phile from http://yourdomain.com/blog
An example Nginx config:
location /blog {
try_files $uri $uri/ @blog;
}
location @blog {
rewrite ^/blog/(.*)$ /blog/index.php/$1;
}
You should spend some time making sure that at least your config.php file cannot be accessed. Especially since it holds an encryption key.
I think the following is a fairly comprehensive list of the files that you should block
location ~ /.git/ { access_log off; log_not_found off; deny all; }
location ~ /(.gitignore|.gitmodules) { access_log off; log_not_found off; deny all; }
location ~ /(build.xml|composer.json|composer.phar|generator.php|lib|phing|README.md) { access_log off; log_not_found off; deny all; }
location ~ /(Changelog.md|composer.lock|config.php|default_config.php|LICENSE) { access_log off; log_not_found off; deny all; }
location ~ /\. { access_log off; log_not_found off; deny all; }
http://philecms.com/ - A flat file CMS with a swappable parser and template engine.