| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #
- {
- debug
- skip_install_trust
- }
- {$SERVER_NAME:localhost} {
- # Enable compression (optional)
- encode zstd br gzip
- # Long-lived caching for real static assets. Storage (/s/*) serves files
- # through storage.php, which sets its own headers (private files included),
- # so it is excluded here.
- @static {
- path *.woff2 *.woff *.ttf *.otf *.eot *.svg *.png *.jpg *.jpeg *.gif *.webp *.avif *.ico *.css *.js *.mjs *.map
- not path /s/*
- }
- header @static Cache-Control "public, max-age=2592000"
- # Add trailing slash for directory requests
- @canonicalPath {
- file {path}/index.php
- not path */
- }
- redir @canonicalPath {path}/ 308
- @unapages path_regexp ^/page/(.*)$
- rewrite @unapages /page.php?i={re.unapages.1}
- @unamodules path_regexp ^/m/(.*)$
- rewrite @unamodules /modules/index.php?r={re.unamodules.1}
- @unastorage path_regexp ^/s/([a-zA-Z0-9_]+)/([a-zA-Z0-9\.]+)
- rewrite @unastorage /storage.php?o={re.unastorage.1}&f={re.unastorage.2}
- @unaMissing {
- not file
- not path */
- path_regexp una ^/(.+)$
- }
- rewrite @unaMissing /r.php?_q={re.una.1}&{query}
- try_files {path} {path}/index.php {path}/index.html
- # FrankenPHP!
- @phpFiles path *.php
- php @phpFiles
- file_server
- }
|