|
15 | 15 | # Enable compression |
16 | 16 | encode gzip |
17 | 17 |
|
| 18 | + # PHP Handler for FrankenPHP |
| 19 | + php_server |
| 20 | + |
18 | 21 | # Exclude assets from being handled by router |
19 | 22 | @assets path /admin/assets* |
20 | 23 | file_server @assets |
|
30 | 33 | rewrite @setup /setup/index.php |
31 | 34 |
|
32 | 35 | # Administration API |
33 | | - route /admin/api/* { |
34 | | - rewrite * /admin/api/index.php |
35 | | - php_server |
36 | | - } |
| 36 | + @admin_api path /admin/api/* |
| 37 | + rewrite @admin_api /admin/api/index.php |
37 | 38 |
|
38 | | - # Administration pages - handle /admin and /admin/ and subpaths |
39 | | - route /admin/* { |
40 | | - uri strip_prefix /admin |
41 | | - rewrite * /admin/index.php |
42 | | - php_server |
43 | | - } |
| 39 | + # Redirect /admin to /admin/ |
| 40 | + @admin_exact path_regexp ^/admin$ |
| 41 | + redir @admin_exact /admin/ 301 |
44 | 42 |
|
45 | | - # Exact match for /admin -> treat as /admin/ |
46 | | - route /admin { |
47 | | - uri strip_suffix /admin |
| 43 | + # Administration pages |
| 44 | + handle_path /admin/* { |
48 | 45 | rewrite * /admin/index.php |
49 | | - php_server |
50 | 46 | } |
51 | 47 |
|
52 | | - # All API routes (catch-all, including v3.0, v3.1, translations, etc.) |
53 | | - @api path /api* |
| 48 | + # API routes (all API endpoints) |
| 49 | + @api path /api/* |
54 | 50 | rewrite @api /api/index.php |
55 | 51 |
|
56 | | - # PHP Handler für FrankenPHP |
57 | | - php_server |
58 | | - |
59 | 52 | file_server |
60 | 53 |
|
61 | 54 | header { |
|
82 | 75 | # TLS configuration with your certificate files |
83 | 76 | tls /etc/ssl/cert.pem /etc/ssl/cert-key.pem |
84 | 77 |
|
85 | | - # Gleiche Rewrite-Regeln wie für Port 80 |
| 78 | + # PHP Handler for FrankenPHP |
| 79 | + php_server |
| 80 | + |
| 81 | + # Exclude assets from being handled by router |
86 | 82 | @assets path /admin/assets* |
87 | 83 | file_server @assets |
88 | 84 |
|
| 85 | + # Error pages |
89 | 86 | handle_errors 404 { |
90 | 87 | rewrite * /404.html |
91 | 88 | php_server |
92 | 89 | } |
93 | 90 |
|
| 91 | + # Setup and update pages |
94 | 92 | @setup path /setup* |
95 | 93 | rewrite @setup /setup/index.php |
96 | 94 |
|
97 | 95 | @update path /update* |
98 | 96 | rewrite @update /update/index.php |
99 | 97 |
|
100 | 98 | # Administration API |
101 | | - route /admin/api/* { |
102 | | - rewrite * /admin/api/index.php |
103 | | - php_server |
104 | | - } |
| 99 | + @admin_api path /admin/api/* |
| 100 | + rewrite @admin_api /admin/api/index.php |
105 | 101 |
|
106 | | - # Administration pages - handle /admin and /admin/ and subpaths |
107 | | - route /admin/* { |
108 | | - uri strip_prefix /admin |
109 | | - rewrite * /admin/index.php |
110 | | - php_server |
111 | | - } |
| 102 | + # Redirect /admin to /admin/ |
| 103 | + @admin_exact path_regexp ^/admin$ |
| 104 | + redir @admin_exact /admin/ 301 |
112 | 105 |
|
113 | | - # Exact match for /admin -> treat as /admin/ |
114 | | - route /admin { |
115 | | - uri strip_suffix /admin |
| 106 | + # Administration pages |
| 107 | + handle_path /admin/* { |
116 | 108 | rewrite * /admin/index.php |
117 | | - php_server |
118 | 109 | } |
119 | 110 |
|
120 | | - # All API routes (catch-all, including v3.0, v3.1, translations, etc.) |
121 | | - @api path /api* |
| 111 | + # API routes (all API endpoints) |
| 112 | + @api path /api/* |
122 | 113 | rewrite @api /api/index.php |
123 | 114 |
|
124 | | - # PHP Handler für FrankenPHP |
125 | | - php_server |
126 | | - |
127 | 115 | file_server |
128 | 116 |
|
129 | 117 | header { |
|
0 commit comments