mirror of
https://github.com/getformwork/formwork.git
synced 2025-01-17 21:49:04 +01:00
28 lines
854 B
Nginx Configuration File
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;
|
|
}
|
|
}
|