formwork/nginx.conf
2018-08-29 13:31:32 +02:00

28 lines
854 B
Nginx Configuration File

## Put these lines in the server block of your webserver nginx.conf file
charset utf-8;
location / {
## Prevent direct access to Formwork folders
## but allow access to template assets
rewrite ^/templates/assets/(.*) /templates/assets/$1 break;
rewrite ^/(cache|config|formwork|templates|vendor)/.* index.php last;
rewrite ^/(.*)\.(md|yml|json)/?$ /index.php last;
rewrite ^/(LICENSE|composer\.lock|\.gitignore|\.php_cs|nginx.conf)/?$ /index.php last;
## Let all URI be processed by index.php
if (!-e $request_filename) {
rewrite ^/.* /index.php;
}
}
location /admin {
rewrite ^/admin/(accounts|languages|logs|schemes|src|views)/.* /admin/index.php last;
rewrite ^/admin/gulpfile\.js/?$ /admin/index.php last;
if (!-e $request_filename) {
rewrite ^/admin/.* /admin/index.php;
}
}