v0.42.2_fix2

This commit is contained in:
Mateusz Gruszczyński committed 2026-11-26 13:06:54 +01:00
1 parent 25148f26eb
commit a75893d428
16 files changed
+300 -65

No files matched your search

+4
View File
@@ -4,6 +4,10 @@ Release history focused on **features, settings, default behavior, compatibility
## 0.42.2 — Generic FastCGI/CGI hosting and Apache compatibility ## 0.42.2 — Generic FastCGI/CGI hosting and Apache compatibility
- **Vhost Web Server / Custom locations hotfix:** the Vhost panel no longer requires a Reverse Proxy backend for local redirects, local HTTP responses, disabled proxy routes or Web Service-only locations. Backend requirement and backend status labels use the same active-source predicate as Rust validation; enabled Reverse Proxy sources still require a backend. Regression checks cover an exact-root redirect, a local response and an active proxy exception.
- **FastCGI profile editor UI:** wrapped dialog text and responsive profile forms; backend badge and dedicated PHP-FPM-only section. Switching to fcgiwrap/general FastCGI hides php.ini inputs and excludes them from the saved handler configuration. Local Web Service editor follows the selected handler/profile as well; generic labels are used for common limits. The FastCGI guide includes a real Nagios Core migration example without hard-coding application-specific paths.
- **Web Server `.htaccess` routing fix:** `AcceptPathInfo On/Off/Default` now controls safe FastCGI script suffix dispatch instead of being silently skipped; the original suffix (including final slash) becomes `PATH_INFO`, with `SCRIPT_FILENAME` still constrained to the real script. `RewriteBase` is parsed and applied to relative targets. Default PHP-capable Web Services try `index.php` after the static index names unless an explicit index list was set. Local `ErrorDocument` URL targets (HTTP 400–599) are rendered once for GET/HEAD with the original status preserved; other handlers and unsafe targets remain unsupported. Misconfigured `.php` front-controller rewrites produce a Web Service warning when there is no enabled `.php` FastCGI handler. Regression tests cover a realistic PHP front-controller `.htaccess`, static assets, root indexes, disabled PATH_INFO, local errors and nested base paths. `Options MultiViews`/`FollowSymlinks` continue as explicitly warned unsupported options rather than being falsely reported as supported. - **Web Server `.htaccess` routing fix:** `AcceptPathInfo On/Off/Default` now controls safe FastCGI script suffix dispatch instead of being silently skipped; the original suffix (including final slash) becomes `PATH_INFO`, with `SCRIPT_FILENAME` still constrained to the real script. `RewriteBase` is parsed and applied to relative targets. Default PHP-capable Web Services try `index.php` after the static index names unless an explicit index list was set. Local `ErrorDocument` URL targets (HTTP 400–599) are rendered once for GET/HEAD with the original status preserved; other handlers and unsafe targets remain unsupported. Misconfigured `.php` front-controller rewrites produce a Web Service warning when there is no enabled `.php` FastCGI handler. Regression tests cover a realistic PHP front-controller `.htaccess`, static assets, root indexes, disabled PATH_INFO, local errors and nested base paths. `Options MultiViews`/`FollowSymlinks` continue as explicitly warned unsupported options rather than being falsely reported as supported.
- **Maintenance: status-only Apache redirects:** accept `RedirectMatch 404 /\.` and other bounded 404/410 status-only Redirect/RedirectMatch forms without a target URL. Return the requested status with no `Location` header; keep path hardening and redirect validation. Add a regression fixture with a typical PHP front-controller `.htaccess` file, including unsupported non-security directives in non-strict mode. - **Maintenance: status-only Apache redirects:** accept `RedirectMatch 404 /\.` and other bounded 404/410 status-only Redirect/RedirectMatch forms without a target URL. Return the requested status with no `Location` header; keep path hardening and redirect validation. Add a regression fixture with a typical PHP front-controller `.htaccess` file, including unsupported non-security directives in non-strict mode.
+16 -14
View File
@@ -2,7 +2,7 @@
4140a2956264b44f259e6a37fc00ba02097bbe68b09296e04d3d243c1287129b .env.example 4140a2956264b44f259e6a37fc00ba02097bbe68b09296e04d3d243c1287129b .env.example
0a5e87541831edca0e7164c6469dba01a8a7053ab14dbfb8019c83e4db10edc2 .gitignore 0a5e87541831edca0e7164c6469dba01a8a7053ab14dbfb8019c83e4db10edc2 .gitignore
3c4638dc086333b8383c5bc77fe967b790075439f5e7a8257e5dd0dd4cf4233b AGENTS.md 3c4638dc086333b8383c5bc77fe967b790075439f5e7a8257e5dd0dd4cf4233b AGENTS.md
47dff846d956b68ef225d0c6332ea9ed4b4248db2f26aef9a615c510c3d24cb9 CHANGELOG.md e9c7db0ca1e5d13bf98e6a9a590ec875d6bb3bc29a92cf84915e2cd61e17881a CHANGELOG.md
c28d825120a878684b511b1a6a4f372aced5098ed7b9bec8b318c4ec3fb1cbf4 Cargo.lock c28d825120a878684b511b1a6a4f372aced5098ed7b9bec8b318c4ec3fb1cbf4 Cargo.lock
3ac98730af5caa39f81d28f4a4f7f14710fbb53d625794dd5704e65afebe4d8e Cargo.toml 3ac98730af5caa39f81d28f4a4f7f14710fbb53d625794dd5704e65afebe4d8e Cargo.toml
788745d4f70a0382c6280020afbd48844bb2af65e835a826852143f8132cdeca Dockerfile 788745d4f70a0382c6280020afbd48844bb2af65e835a826852143f8132cdeca Dockerfile
@@ -45,10 +45,10 @@ bfe96dd91dfc6e07918a662d98b036f12ceb011a5aa8381b3778bd0c964b19ab docs/CACHE.md
51d34823d139ff3b0b8e1cf1a31850746be5ed7da847a2cca51be36fd5f7733a docs/CACHE_TEMPLATE_LIBRARY.md 51d34823d139ff3b0b8e1cf1a31850746be5ed7da847a2cca51be36fd5f7733a docs/CACHE_TEMPLATE_LIBRARY.md
31285f000cf725d018a926023fe608fec983b959053f7a55e0954b962a8bc20c docs/CERTIFICATES.md 31285f000cf725d018a926023fe608fec983b959053f7a55e0954b962a8bc20c docs/CERTIFICATES.md
81df6715e2f07617fe0bbb0960c4d5bdac28cf665ce7297fa3768118e6ab28ba docs/CONFIGURATION.md 81df6715e2f07617fe0bbb0960c4d5bdac28cf665ce7297fa3768118e6ab28ba docs/CONFIGURATION.md
966a1c49274c45568cf2b34158900524471f50d796d227a02db49c57941cc808 docs/CUSTOM_LOCATIONS.md 2cede323fe2767100258b5e1d3e3a8b362e2a91acf2b0ee61090c4a2db97d952 docs/CUSTOM_LOCATIONS.md
16d4510e38d43c3bbde9b7dab7af3aeb0cb837dc2f1956cfaad7a9a11bea3bfc docs/DASHBOARD.md 16d4510e38d43c3bbde9b7dab7af3aeb0cb837dc2f1956cfaad7a9a11bea3bfc docs/DASHBOARD.md
53cb0ce7db5ce25e4c2381de3a6e875d212deeed08861da63050de6c51a442bd docs/DOCKER_DISCOVERY.md 53cb0ce7db5ce25e4c2381de3a6e875d212deeed08861da63050de6c51a442bd docs/DOCKER_DISCOVERY.md
6a8ccaa0220acce78e596360998752e859fc53984410e8cc5f4c33cc92317d36 docs/FASTCGI.md 3e729724030fd38d2d77272fddbb6509b7cd971c6bf0e9e3ef234ad69e342156 docs/FASTCGI.md
d86b3d705d0cc46182c355deeb3d6e88bcf81d031560aad0eb4cc3dee3b38ec8 docs/FEATURES.md d86b3d705d0cc46182c355deeb3d6e88bcf81d031560aad0eb4cc3dee3b38ec8 docs/FEATURES.md
f7bb59821e0d6c45ae2a1789086fd9dab33d91c0ceae784ae68f64bd13b5f496 docs/HEADLESS.md f7bb59821e0d6c45ae2a1789086fd9dab33d91c0ceae784ae68f64bd13b5f496 docs/HEADLESS.md
bce732d845c23ad677ae811e7529b9322ab41d04ca808e04087d0f76bccd9309 docs/INSTALL.md bce732d845c23ad677ae811e7529b9322ab41d04ca808e04087d0f76bccd9309 docs/INSTALL.md
@@ -70,7 +70,7 @@ df83d07d7186a5eea60d206dee3cb62b7f6505a066d84141fc53130e2f29760b docs/TROUBLESH
53005e1eeb460c960794e2b2f1ab7cfc472c510b14bea3193d25f5f81ba7a1e4 docs/VCL.md 53005e1eeb460c960794e2b2f1ab7cfc472c510b14bea3193d25f5f81ba7a1e4 docs/VCL.md
4a5534b628c18f4e83c67c6136b60969c884391fbe55cc6bd4f2354711d8ffb7 docs/VCL_SUPPORT_MATRIX.md 4a5534b628c18f4e83c67c6136b60969c884391fbe55cc6bd4f2354711d8ffb7 docs/VCL_SUPPORT_MATRIX.md
382e084a1f9e35627ccb43eaf451c18fb6d0cc752397c2178108d71de592a931 docs/VCL_TRAFFIC_COOKBOOK.md 382e084a1f9e35627ccb43eaf451c18fb6d0cc752397c2178108d71de592a931 docs/VCL_TRAFFIC_COOKBOOK.md
181444ea2c28171ed89ead25dcfc60ee6bd05f7b01c1a49d8248a307dc9be7a4 docs/VHOSTS.md a382a9d4b0acb04f1d0a1049f14d30e5e21e1b697012d465e8bfc5e8281a3894 docs/VHOSTS.md
bccc92cf4d751c05a4a315076739582fe0f307b54fd4f26273fa4a3caaa1a23d docs/WEB_SERVER.md bccc92cf4d751c05a4a315076739582fe0f307b54fd4f26273fa4a3caaa1a23d docs/WEB_SERVER.md
42822b1c9801bcadb0e2d785cb91883ca2df1da141222631f153030c95f5e197 docs/images/about.png 42822b1c9801bcadb0e2d785cb91883ca2df1da141222631f153030c95f5e197 docs/images/about.png
deff2393a987ac7102179dc85b48baf2c4a3882291bb8c7c584d760cc497c631 docs/images/api.png deff2393a987ac7102179dc85b48baf2c4a3882291bb8c7c584d760cc497c631 docs/images/api.png
@@ -137,8 +137,8 @@ e9cbb0224c4a3d23a6019ba557e0cd568c1ad5e1582ff1e335fb7d99b7a1055d integrations/r
3f092a9ab80221eddd67be4d1a776acbc6e04c1eb6011b588280c28e83b2582f integrations/routeros-oci-build/build-routeros-oci.sh 3f092a9ab80221eddd67be4d1a776acbc6e04c1eb6011b588280c28e83b2582f integrations/routeros-oci-build/build-routeros-oci.sh
3f267cafa16006e5456ade78ee2d5fae02cc7ce747839523068ffd8d7c98798a integrations/routeros-oci-build/docker-entrypoint.sh 3f267cafa16006e5456ade78ee2d5fae02cc7ce747839523068ffd8d7c98798a integrations/routeros-oci-build/docker-entrypoint.sh
ae2ee2887fcba096d0de25edcc18faa1ffec35759274518db1bf6d6982f7176c langs/README.md ae2ee2887fcba096d0de25edcc18faa1ffec35759274518db1bf6d6982f7176c langs/README.md
a899c29ec4d21c6feb436567626b82a0c97c8b494b4976a4e93caed74b37b144 langs/en_US.json a97c2e145a407b016b47bf361741f3c6248499dde74372587025f1e0d04bd8bc langs/en_US.json
eb1aa36fdb83b224e64a47ac13816a63811069beec22751efea6a8632444d1c1 langs/pl_pl.json eae13817e05269807ed19b9e1cb78cdda7e3e65ae43a00c84e787d868e30e175 langs/pl_pl.json
38773ed251a8c24af353f4744e498ae2bc7d4151df7927e942c4ac223f6008e1 make_zip.py 38773ed251a8c24af353f4744e498ae2bc7d4151df7927e942c4ac223f6008e1 make_zip.py
e830d37dd1f81a4b0aa7d535f5bba69e34e433b0fd99cc8ee0b296786c32379a migrations/0002_admin.sql e830d37dd1f81a4b0aa7d535f5bba69e34e433b0fd99cc8ee0b296786c32379a migrations/0002_admin.sql
20112cc82192098b8d602f1c4f7ca08712e9e1366c845fabb92753187c370d35 migrations/0003_certificate_renewals.sql 20112cc82192098b8d602f1c4f7ca08712e9e1366c845fabb92753187c370d35 migrations/0003_certificate_renewals.sql
@@ -177,6 +177,7 @@ be88ca2163d84913e0d9ee97f95d3217d4a92fc7df122927336deae5f8fcfb3d scripts/prefli
2a95ee85848d347b419dcc2c3a1c65b62d491081a554f5fb50623770a5c15b80 scripts/runtime/acme_provider.py 2a95ee85848d347b419dcc2c3a1c65b62d491081a554f5fb50623770a5c15b80 scripts/runtime/acme_provider.py
e69813fb1d3a4cdcfb7243964cc323fc21a603087bf2e84188fa42b9d3cee4b5 scripts/runtime/acme_rfc2136.py e69813fb1d3a4cdcfb7243964cc323fc21a603087bf2e84188fa42b9d3cee4b5 scripts/runtime/acme_rfc2136.py
91c883cfdce94c8c22c98749f611317f538a112d29be4f3fb1fa460b8f29ceaa scripts/start_stream_backends.sh 91c883cfdce94c8c22c98749f611317f538a112d29be4f3fb1fa460b8f29ceaa scripts/start_stream_backends.sh
01f0df9510163760d41d2e475b5fd00d1084cb2b2aff835f2abdef728b32ad02 scripts/test_vhost_source.js
22e880e98c7b9d700c7a4c02b9b1d543e5dbd1f4ecdca42813a1083165b32a19 scripts/version.py 22e880e98c7b9d700c7a4c02b9b1d543e5dbd1f4ecdca42813a1083165b32a19 scripts/version.py
78efae6c43732c0f5527d467bf07d1f890da361925416c89b58bc449d852fc2b src/acl.rs 78efae6c43732c0f5527d467bf07d1f890da361925416c89b58bc449d852fc2b src/acl.rs
f097cce1f831e01b68688eb60c1b6393413131e6543c4627f3cedd9ef706193b src/acl/dynamic/mod.rs f097cce1f831e01b68688eb60c1b6393413131e6543c4627f3cedd9ef706193b src/acl/dynamic/mod.rs
@@ -224,7 +225,7 @@ ea202c67d9acb7614046f153beecdff10d5822b3d5627eaf2ebda33954b36474 src/admin/pref
62ecbae5dee00aeeca3eb806e2605372471dfab971cde8f66f11e711df8fcea1 src/admin/public/mod.rs 62ecbae5dee00aeeca3eb806e2605372471dfab971cde8f66f11e711df8fcea1 src/admin/public/mod.rs
7a00e4ab943f74d2b1bdcbfab7f9cd3f584e9f59536b4aca6c4c31f5f5508d12 src/admin/public/tests.rs 7a00e4ab943f74d2b1bdcbfab7f9cd3f584e9f59536b4aca6c4c31f5f5508d12 src/admin/public/tests.rs
6930b4f4b45257772b321b20a9becdf9bc4610274852948ba38c2d0cdf02dfaf src/admin/refresh_preferences.rs 6930b4f4b45257772b321b20a9becdf9bc4610274852948ba38c2d0cdf02dfaf src/admin/refresh_preferences.rs
3d210447933638b507e70692bcbacf7bb1bb1a62f9bf3b3300ee0dc5c7c3e20e src/admin/router.rs fb612856189d447f6f2dc88b5a854e51db7f06c518bba4a1432ec6f0d0f9c4f5 src/admin/router.rs
fba52102e77ca8871a42f97c91be8f10a9aa4f997868652d550fff3fbd41b66e src/admin/session.rs fba52102e77ca8871a42f97c91be8f10a9aa4f997868652d550fff3fbd41b66e src/admin/session.rs
38f53c52c2e3bc49b5ad4254c657d282cf4ca7c8c11c6a79cc1d7a2086f017de src/admin/status.rs 38f53c52c2e3bc49b5ad4254c657d282cf4ca7c8c11c6a79cc1d7a2086f017de src/admin/status.rs
bac2116e9a7d5f19a112565e1483787ff6102f489bed0cb3b0b3e2102ddd3edb src/admin/status_live.rs bac2116e9a7d5f19a112565e1483787ff6102f489bed0cb3b0b3e2102ddd3edb src/admin/status_live.rs
@@ -267,7 +268,7 @@ ba22ff211f408052aee0aa75a5a52734b1c257247e7112972aff75a9646faf22 src/admin/web/
433f5ccf0a4df1c4452f746f7b2f351f6712ee73873cb07204638c205e4f2c88 src/admin/web/cache-rules.js 433f5ccf0a4df1c4452f746f7b2f351f6712ee73873cb07204638c205e4f2c88 src/admin/web/cache-rules.js
6288b0a8228d828ac2e2535ace2d1aefd1c04011e789eb97f7279129874ac35c src/admin/web/certificate-api.js 6288b0a8228d828ac2e2535ace2d1aefd1c04011e789eb97f7279129874ac35c src/admin/web/certificate-api.js
c2912a5e218896177776d4c5920e240092a3de66f9a4b95c1631796771e0ce3c src/admin/web/css/00-tokens.css c2912a5e218896177776d4c5920e240092a3de66f9a4b95c1631796771e0ce3c src/admin/web/css/00-tokens.css
79f62673d36fd7ddc2b79729bcfc2b80d290712e38d3b6f18fca4573487c6959 src/admin/web/css/10-base.css 7b74fd7837ed42a9334dce8e21bdb03fa00a90f0e396e239ac1fc1dbb71f06b8 src/admin/web/css/10-base.css
9cd9b62ff8cfba47cb180e29ea5f69b8e97c7817dfcfddcb55fc4e08d11a7184 src/admin/web/css/20-shell.css 9cd9b62ff8cfba47cb180e29ea5f69b8e97c7817dfcfddcb55fc4e08d11a7184 src/admin/web/css/20-shell.css
5af483ff7937ff245d8718179dc6001716d2b279f6ce935f5aa0c9fcfa370ab8 src/admin/web/css/30-overview.css 5af483ff7937ff245d8718179dc6001716d2b279f6ce935f5aa0c9fcfa370ab8 src/admin/web/css/30-overview.css
2763ff8969567cbd001ba4b5d5b669aea7aec347088ffe7c2b164b82396755d5 src/admin/web/css/40-editors.css 2763ff8969567cbd001ba4b5d5b669aea7aec347088ffe7c2b164b82396755d5 src/admin/web/css/40-editors.css
@@ -302,7 +303,7 @@ e6c4d91d1542d0a5b47bb8736f9539d43a6713df5a473b635519d5b7eac2eb9c src/admin/web/
0a5fff35555153f59d4346933030a67b6e1a8768cee7a47cfa2fcf1a2c564f63 src/admin/web/favicon.svg 0a5fff35555153f59d4346933030a67b6e1a8768cee7a47cfa2fcf1a2c564f63 src/admin/web/favicon.svg
e0f0b302092ced1c84ef7e99864984444f0e9d4e3b7d85e74d3507d566952a7f src/admin/web/file-logs.js e0f0b302092ced1c84ef7e99864984444f0e9d4e3b7d85e74d3507d566952a7f src/admin/web/file-logs.js
85f54ce519140a38e31fb1b3d5974585748d7162f0499aa63703c1db56334b2c src/admin/web/host404.js 85f54ce519140a38e31fb1b3d5974585748d7162f0499aa63703c1db56334b2c src/admin/web/host404.js
e41461c7acd92b83bc6074ac97b6764847a3f7985c03a3120531e98f9db8cfe7 src/admin/web/index.html 168edd2122464c5f1004e870f23933c4ded14eb6106dd92cc1e36c2567f6f9c5 src/admin/web/index.html
be9999a001c59630963d60539e860b59999dcf74c5ff0087b12a6fb69b4e7bd2 src/admin/web/integrations.js be9999a001c59630963d60539e860b59999dcf74c5ff0087b12a6fb69b4e7bd2 src/admin/web/integrations.js
7a12f020fc587205694978ab41b660e9a80487d413fbf6e34fc525eabc58308f src/admin/web/login-keys.json 7a12f020fc587205694978ab41b660e9a80487d413fbf6e34fc525eabc58308f src/admin/web/login-keys.json
ac9f667273918e18406df06cb2613c923f50a88897693a03a18f500e22dc6ec2 src/admin/web/login.html ac9f667273918e18406df06cb2613c923f50a88897693a03a18f500e22dc6ec2 src/admin/web/login.html
@@ -323,15 +324,16 @@ bb16f579d1de89c565c95adb496def4051553f17d928d2128f4bf08ca66e5ca1 src/admin/web/
675ea169d4cc55fda5e291af536338b882bede1eaa6c9d5cc7dfde0779c7c4d1 src/admin/web/transform-panel.js 675ea169d4cc55fda5e291af536338b882bede1eaa6c9d5cc7dfde0779c7c4d1 src/admin/web/transform-panel.js
c30373b0f2dc5672f88bc6fad0ffd5f6d85496d75da8fae83c6aa306e4e0f676 src/admin/web/vhosts/balancing.js c30373b0f2dc5672f88bc6fad0ffd5f6d85496d75da8fae83c6aa306e4e0f676 src/admin/web/vhosts/balancing.js
2035bbee6d91aa124fecc0de4fb97c418b7cdba7fb06a3dde0885b929bc9ffff src/admin/web/vhosts/core.js 2035bbee6d91aa124fecc0de4fb97c418b7cdba7fb06a3dde0885b929bc9ffff src/admin/web/vhosts/core.js
3865d62d562f1aed0405bc4a392c2c977ecbe8a330f344bb501a70edb028ea20 src/admin/web/vhosts/editor.js 1920fd45cb922ffdea5401f998f1307fb021174fefa9a1a35e4659960b2c6b2c src/admin/web/vhosts/editor.js
f082588c35d981fc689542d4c12a7614638279335220d587fdee5d3fff822e80 src/admin/web/vhosts/headers-tab.js f082588c35d981fc689542d4c12a7614638279335220d587fdee5d3fff822e80 src/admin/web/vhosts/headers-tab.js
3776f72d7051af86ac5fbdd4581040dd88a424c0c6cde789301b032b159094d8 src/admin/web/vhosts/health.js 3776f72d7051af86ac5fbdd4581040dd88a424c0c6cde789301b032b159094d8 src/admin/web/vhosts/health.js
b3239e67901f1796d7a974ade0796f2e3590ff8064628a5629b78c7f6ce2f32e src/admin/web/vhosts/protocol.js b3239e67901f1796d7a974ade0796f2e3590ff8064628a5629b78c7f6ce2f32e src/admin/web/vhosts/protocol.js
8c3da49973c62333559b0e3588c02beb0b425c025eac5cfa82a1bb968f70d9dd src/admin/web/vhosts/rates.js 8c3da49973c62333559b0e3588c02beb0b425c025eac5cfa82a1bb968f70d9dd src/admin/web/vhosts/rates.js
fafb4f9e8f123c93a5277052a375a9d2dd8f986322abd17f2206c16f0c37df06 src/admin/web/vhosts/render.js 76f603802ad3e19005de583fcaac24b61b5bc79317894fca2fd9fd974b5f33fd src/admin/web/vhosts/render.js
90684f1bfb0e079438654e1f8c5b9ee1b4f74e49126a82c88768f3ae209a1875 src/admin/web/vhosts/routing.js 90684f1bfb0e079438654e1f8c5b9ee1b4f74e49126a82c88768f3ae209a1875 src/admin/web/vhosts/routing.js
b78d058deabc6a238560222bfdf131df3812407f73bdd000279df273b5d5dfc9 src/admin/web/web-server-profiles.js 7be5a5fed5480b431d2eece59271c2567dd48592b9d7e65fdb30b4a28f58ce3a src/admin/web/vhosts/source.js
c373850916ed66250583ebafa960e5c2a22ff3d0c63610ec61a1d16810bf5b17 src/admin/web/web-server.js b6f06f16e4035d856f13a633e51fd6bd1de23b872fc1b47726557554ef2a8a42 src/admin/web/web-server-profiles.js
31cc5bc08cb1d34cfbed206277eeed0f4dd09333de0ff0537bd67b404f1184de src/admin/web/web-server.js
36f11beed56711640bb56bb6f452bf76dec2ce4be6a57e8abc19560af477c870 src/alerts.rs 36f11beed56711640bb56bb6f452bf76dec2ce4be6a57e8abc19560af477c870 src/alerts.rs
2d40c2cb32d7365df0c9cd6c8cb6f0483c7a799786c648f4836a0d9740c6c5ef src/auth/files/mod.rs 2d40c2cb32d7365df0c9cd6c8cb6f0483c7a799786c648f4836a0d9740c6c5ef src/auth/files/mod.rs
b2f948bcc3dbd24952c7b1b02d41d06757f49f0c38a78caf51f8f8a687d8480d src/auth/files/tests.rs b2f948bcc3dbd24952c7b1b02d41d06757f49f0c38a78caf51f8f8a687d8480d src/auth/files/tests.rs
@@ -625,7 +627,7 @@ f8b3f8e45306b13ee925f5cb54f8e2de1934314e2c590f14be7ca3814438f4af src/vhost/cond
846707452ccf10962f1763be66b8f56c050b0398b48968015fb799dac289c0d6 src/vhost/error_fallback.rs 846707452ccf10962f1763be66b8f56c050b0398b48968015fb799dac289c0d6 src/vhost/error_fallback.rs
a7b789d92cda754ba74f6b2c8de0693626b311112cf50b6a73fbe3f52dbeade5 src/vhost/model.rs a7b789d92cda754ba74f6b2c8de0693626b311112cf50b6a73fbe3f52dbeade5 src/vhost/model.rs
fc8af7342a3b147921e9040116af5dfe680b3df910db2416ada18198bbeea7df src/vhost/redirect.rs fc8af7342a3b147921e9040116af5dfe680b3df910db2416ada18198bbeea7df src/vhost/redirect.rs
5a5768740e9a486436f6bb4e285ed99fd445cabbc21f317a47dc32c1f7091385 src/vhost/tests.rs c8722700c4e42b5daa212e70a4c56938f41c1ada8c541cb6b614a2d496369741 src/vhost/tests.rs
34ffb202075c9fa720d2a23c6d901471655befe583a6335d778391d467cc8186 src/vhost/validation.rs 34ffb202075c9fa720d2a23c6d901471655befe583a6335d778391d467cc8186 src/vhost/validation.rs
8d1eff4b24f01d137414ef5419f75dd281879228adb70409645b11b3c78c20e9 src/web_server/config.rs 8d1eff4b24f01d137414ef5419f75dd281879228adb70409645b11b3c78c20e9 src/web_server/config.rs
77e030e44dfb3019765927a42626f6154df423b74f816e6432dec1df14572e65 src/web_server/config/compile.rs 77e030e44dfb3019765927a42626f6154df423b74f816e6432dec1df14572e65 src/web_server/config/compile.rs
+2
View File
@@ -75,6 +75,8 @@ Example — beta testers by header, office network with a staff cookie for the w
- **Local response:** return a chosen `200–599` status, content type and body without connecting to an origin. `HEAD`, `204` and `304` do not return a body. - **Local response:** return a chosen `200–599` status, content type and body without connecting to an origin. `HEAD`, `204` and `304` do not return a body.
- **Redirect:** issue `301`, `302`, `303`, `307` or `308` to a valid absolute HTTP(S) target. Query preservation is configurable. Redirect rewrite expressions may reference regex captures. - **Redirect:** issue `301`, `302`, `303`, `307` or `308` to a valid absolute HTTP(S) target. Query preservation is configurable. Redirect rewrite expressions may reference regex captures.
**Web Service Vhosts do not need a Reverse Proxy backend** just to use a Redirect or Local response location. Only the main Reverse Proxy source or an enabled Proxy location requires a backend pool. To redirect only `/` to an application prefix, choose **Exact** match for `/` (not Prefix `/`, which also matches application subpaths), **Redirect**, and a code such as **302** with an absolute destination URL.
### Path rewriting ### Path rewriting
`preserve` forwards the original path, `strip_prefix` removes the matched prefix, `replace_prefix` substitutes a new normalized prefix and `regex` rewrites using captures such as `$1` or `${name}`. Queries remain intact unless a redirect explicitly changes handling. Public cache keys are based on the client-facing URL, not an internal rewritten backend path. `preserve` forwards the original path, `strip_prefix` removes the matched prefix, `replace_prefix` substitutes a new normalized prefix and `regex` rewrites using captures such as `$1` or `${name}`. Queries remain intact unless a redirect explicitly changes handling. Public cache keys are based on the client-facing URL, not an internal rewritten backend path.
+44
View File
@@ -68,6 +68,50 @@ The exact and regex rules use Rust's `regex` syntax, not PCRE look-arounds. `str
**Protect access:** Enable **Vhost Basic Auth** if the application needs it, using the existing RustProxy credential settings (or another supported authentication provider; only verified Vhost Basic Auth currently maps to `REMOTE_USER`). Avoid publishing admin/CGI directories as static paths. `deny all` for hidden files can be implemented with Vhost ACL/location rules and optional `.htaccess` security rules. Server-level HTTPS, certificate renewal, IPv6 listeners and access/error logging are configured through RustProxy listeners/Vhosts/logs, not inside FastCGI settings. **Protect access:** Enable **Vhost Basic Auth** if the application needs it, using the existing RustProxy credential settings (or another supported authentication provider; only verified Vhost Basic Auth currently maps to `REMOTE_USER`). Avoid publishing admin/CGI directories as static paths. `deny all` for hidden files can be implemented with Vhost ACL/location rules and optional `.htaccess` security rules. Server-level HTTPS, certificate renewal, IPv6 listeners and access/error logging are configured through RustProxy listeners/Vhosts/logs, not inside FastCGI settings.
## Nagios Core: PHP pages and CGI checks under `/nagios/`
The following is a **site-specific example** of the generic three-service arrangement above. It replaces common Angie/Nginx rules for a Nagios Core UI; the FastCGI engine does not contain any Nagios-specific code. Adjust paths and socket names to your installation.
**Prerequisites:** Nagios static/PHP files are under `/usr/local/nagios/share/`, executable CGI files under `/usr/local/nagios/sbin/`, PHP-FPM is listening on `unix:/run/php/php8.3-fpm.sock` and fcgiwrap on `unix:/run/fcgiwrap.socket`. Verify that the RustProxy operating-system account can read the site, traverse both document roots and connect to both Unix sockets. Do not change socket permissions to world-writable as a workaround. CGI programs may require Nagios-specific OS users/groups to read status data.
1. Under **Web Server → FastCGI profiles**, create `nagios-php` with **handler `php_fpm`**, enabled, endpoint `unix:/run/php/php8.3-fpm.sock`, executable extensions `php` and public `SCRIPT_NAME` prefix `/nagios`. Leave `PHP_VALUE` / `PHP_ADMIN_VALUE` at defaults unless the PHP-FPM pool genuinely needs overrides.
2. Create `nagios-cgi` with **handler `fcgiwrap`**, enabled, endpoint `unix:/run/fcgiwrap.socket`, executable extensions `cgi`, public `SCRIPT_NAME` prefix `/nagios/cgi-bin`, and `PATH_INFO` disabled unless a specific script uses it. This handler does **not** use `PHP_VALUE` or `PHP_ADMIN_VALUE`.
3. Create these **Web Services** (the profile and service are separate objects):
| Web Service ID | Document root | Shared profile | Index files | `try_files` |
|---|---|---|---|---|
| `nagios-web` | `/usr/local/nagios/share` | `nagios-php` | `index.php`, `index.html`, `index.htm` | `$uri`, `$uri/`, `=404` |
| `nagios-cgi-scripts` | `/usr/local/nagios/sbin` | `nagios-cgi` | none | `$uri`, `=404` |
| `nagios-empty` | An existing, empty directory such as `/srv/rustproxy/empty` | disabled | none | `=404` |
Keep `symlink_policy=deny` for executable Web Services. The empty default service avoids accidentally exposing the same files outside `/nagios/`.
4. Create a **Vhost** for `n.linuxiarz.pl` on HTTP and HTTPS listeners. Use `nagios-empty` as the default Web Server source; configure a TLS certificate (RustProxy ACME or imported), HTTPS redirection and HTTP/2 as required. Configure Vhost **Basic Auth** with users managed by RustProxy. The Angie `auth_basic_user_file` directive is **not** read automatically; verified Vhost Basic Auth is what supplies `REMOTE_USER` / `AUTH_USER` to CGI. Only enable `pass_authorization` when a script requires `HTTP_AUTHORIZATION`.
5. In **Vhost → Custom locations**, add these entries in the order shown. Choose action **Web Server** for the two service routes, **Redirect** for the first two, and **Local response** for the hidden-file deny. Enter full HTTPS URLs for redirect targets (the Custom location redirect editor requires an absolute URL).
| Match | Pattern | Action / target | Path rewrite |
|---|---|---|---|
| `exact` | `/` | `302` to `https://n.linuxiarz.pl/nagios/` | — |
| `exact` | `/nagios` | `301` to `https://n.linuxiarz.pl/nagios/` | — |
| `regex` | `^/nagios/(?:[^/]+/)*\.[^/]+(?:/|$)` | Local response `403`, no content | — |
| `regex` | `^/nagios/cgi-bin/(.*\.cgi)$` | Web Service `nagios-cgi-scripts` | `regex` → `/$1` |
| `prefix` | `/nagios/` | Web Service `nagios-web` | `strip_prefix` |
The hidden-file rule must be tested before the CGI regex so a dot-prefixed executable cannot bypass it. An additional PHP-specific regex is **unnecessary** here: `nagios-web` serves static files and dispatches `.php` to its PHP-FPM profile. If you need different PHP socket/root rules, use an additional PHP-specific Web Service and a regex Custom location instead.
**Expected mapping:** `GET /nagios/` finds `/usr/local/nagios/share/index.php` (or the configured existing index), `GET /nagios/stylesheets/style.css` stays static, and `GET /nagios/cgi-bin/status.cgi?host=all` selects the CGI Web Service. The latter sends `SCRIPT_FILENAME=/usr/local/nagios/sbin/status.cgi`, `SCRIPT_NAME=/nagios/cgi-bin/status.cgi`, original `REQUEST_URI`, `QUERY_STRING=host=all` and `REMOTE_USER` when RustProxy Basic Auth has successfully authenticated the user. Do **not** add `$1` expressions into Custom FastCGI parameters: core script and identity fields are calculated safely by RustProxy.
Verify after applying the configuration:
```bash
curl -I http://n.linuxiarz.pl/
curl -Ik https://n.linuxiarz.pl/nagios
curl -ik -u operator https://n.linuxiarz.pl/nagios/
curl -ik -u operator 'https://n.linuxiarz.pl/nagios/cgi-bin/status.cgi?host=all'
curl -Ik https://n.linuxiarz.pl/nagios/.htaccess
```
Expect redirects for `/` and `/nagios`, a Basic Auth challenge without credentials, a PHP/static page for `/nagios/`, FastCGI output (not CGI source code) for the CGI URL, and `403` for dotfiles (a Basic Auth challenge may happen first). A `502` suggests a missing backend/socket or bad socket permissions; a `403` can also mean the script is inaccessible/non-executable, and `404` can mean a wrong rewrite or document root. The exact Nagios page may require additional stylesheets/aliases or Nagios-specific CGI environment and permissions. Test these against a real installed Nagios, not only a mock FastCGI server.
## Migrating from Nginx / Angie ## Migrating from Nginx / Angie
| Original directive | RustProxy equivalent | | Original directive | RustProxy equivalent |
+1 -1
View File
@@ -63,7 +63,7 @@ Under **Vhosts → Edit → Security → Country access**, choose `Off`, `Block`
- **Reverse Proxy:** one Vhost has a backend pool. Each member has a configured URL, ID, enabled flag, weight, optional backup/drain state, health settings and capacity limits. - **Reverse Proxy:** one Vhost has a backend pool. Each member has a configured URL, ID, enabled flag, weight, optional backup/drain state, health settings and capacity limits.
- **Web Server:** Vhost references a Web Service by ID. Its document root, directory handling, PHP options and static-file headers remain configured under **Web Server**. - **Web Server:** Vhost references a Web Service by ID. Its document root, directory handling, PHP options and static-file headers remain configured under **Web Server**.
- **Custom locations:** can override selected URL paths and use the default pool, a backend group with its own balancing, a pinned backend, a different Web Service, a redirect or a local response. Unmatched paths still use the main source. Locations and whole-host rules can also require conditions on headers, cookies, query parameters, method, client IP, host or country — see [Request conditions](CUSTOM_LOCATIONS.md#request-conditions-routing-by-header-cookie-ip). - **Custom locations:** can override selected URL paths and use the default pool, a backend group with its own balancing, a pinned backend, a different Web Service, a redirect or a local response. Unmatched paths still use the main source. Locations and whole-host rules can also require conditions on headers, cookies, query parameters, method, client IP, host or country — see [Request conditions](CUSTOM_LOCATIONS.md#request-conditions-routing-by-header-cookie-ip). A Web Server Vhost needs **no proxy backend** when its custom locations are solely local redirects, responses or other Web Services; an enabled Reverse Proxy location still needs a backend.
Sample documents in `examples/vhosts-private.json` and `examples/vhosts-balanced.json` illustrate JSON formats, but their IP addresses, certificates and health endpoints are examples only. Sample documents in `examples/vhosts-private.json` and `examples/vhosts-balanced.json` illustrate JSON formats, but their IP addresses, certificates and health endpoints are examples only.
+9 -8
View File
@@ -9,10 +9,10 @@
"webServiceStaticDeliverySection": "Static file delivery", "webServiceStaticDeliverySection": "Static file delivery",
"webServiceDynamicCompressionSection": "Dynamic compression", "webServiceDynamicCompressionSection": "Dynamic compression",
"webServiceSidecarsSection": "Precompressed assets", "webServiceSidecarsSection": "Precompressed assets",
"webServicePhpSourceSection": "PHP-FPM source and endpoint", "webServicePhpSourceSection": "FastCGI configuration source and endpoint",
"webServicePhpRequestSection": "Request handling", "webServicePhpRequestSection": "Request handling",
"webServicePhpLimitsSection": "Timeouts and capacity", "webServicePhpLimitsSection": "Timeouts and capacity",
"webServicePhpOverridesSection": "FastCGI and php.ini overrides", "webServicePhpOverridesSection": "FastCGI parameters and PHP-FPM options",
"hostIdentitySection": "Host and domains", "hostIdentitySection": "Host and domains",
"streamBackendConnectionSection": "Backend and capacity", "streamBackendConnectionSection": "Backend and capacity",
"streamBackendHealthSection": "Health checks", "streamBackendHealthSection": "Health checks",
@@ -2123,9 +2123,9 @@
"webServicePhpConnectTimeout": "Connect timeout (ms)", "webServicePhpConnectTimeout": "Connect timeout (ms)",
"webServicePhpRequestTimeout": "Total FastCGI request timeout (ms)", "webServicePhpRequestTimeout": "Total FastCGI request timeout (ms)",
"webServicePhpConcurrency": "Max concurrent PHP requests", "webServicePhpConcurrency": "Max concurrent PHP requests",
"webServicePhpBodyLimit": "PHP request body limit (bytes, 0 = unlimited)", "webServicePhpBodyLimit": "FastCGI request body limit (bytes, 0 = unlimited)",
"webServicePhpHeaderLimit": "Max FastCGI response header bytes", "webServicePhpHeaderLimit": "Max FastCGI response header bytes",
"webServicePhpStderrLimit": "Max PHP-FPM stderr log bytes", "webServicePhpStderrLimit": "Max FastCGI STDERR log bytes",
"webServicePhpCustomParams": "Custom FastCGI parameters", "webServicePhpCustomParams": "Custom FastCGI parameters",
"webServicePhpCustomParamsHelp": "One NAME = value per line, e.g. APP_ENV = production. Names: A-Z, digits, underscores; no HTTP_*, PHP_VALUE, PHP_ADMIN_VALUE or core CGI parameters.", "webServicePhpCustomParamsHelp": "One NAME = value per line, e.g. APP_ENV = production. Names: A-Z, digits, underscores; no HTTP_*, PHP_VALUE, PHP_ADMIN_VALUE or core CGI parameters.",
"webServicePhpCustomParamsInvalid": "Custom FastCGI parameters must use one unique NAME = value entry per line.", "webServicePhpCustomParamsInvalid": "Custom FastCGI parameters must use one unique NAME = value entry per line.",
@@ -2621,13 +2621,14 @@
"locationErrorFallbackStatuses": "Intercepted status codes", "locationErrorFallbackStatuses": "Intercepted status codes",
"locationErrorFallbackHelp": "Optional Nginx-style error fallback. Target an enabled internal location by ID. Supported statuses: 403, 404, 500, 502, 503, 504.", "locationErrorFallbackHelp": "Optional Nginx-style error fallback. Target an enabled internal location by ID. Supported statuses: 403, 404, 500, 502, 503, 504.",
"webServicePhpPathInfo": "Enable FastCGI PATH_INFO splitting", "webServicePhpPathInfo": "Enable FastCGI PATH_INFO splitting",
"phpProfileSelect": "PHP-FPM configuration", "phpProfileSelect": "FastCGI configuration source",
"phpProfileLocal": "Local configuration", "phpProfileLocal": "Local configuration",
"phpProfileHelp": "Select a shared FastCGI profile or configure this Web Service directly. Shared edits affect all attached services.", "phpProfileHelp": "Select a shared FastCGI profile or configure this Web Service directly. Shared edits affect all attached services.",
"phpProfileManage": "Manage FastCGI profiles", "phpProfileManage": "Manage FastCGI profiles",
"phpProfileToolbar": "FastCGI profiles", "phpProfileToolbar": "FastCGI profiles",
"phpProfileTitle": "Shared FastCGI profiles", "phpProfileTitle": "Shared FastCGI profiles",
"phpProfileDescription": "Expand a profile to edit it; save applies immediately to every attached Web Service.", "phpProfileDescription": "Expand a profile to edit its settings. Saving updates every attached Web Service immediately. php.ini fields are available only for PHP-FPM.",
"phpProfilePhpOnlySection": "PHP-FPM only: php.ini overrides",
"phpProfileAdd": "Add profile", "phpProfileAdd": "Add profile",
"phpProfileNew": "New PHP-FPM profile", "phpProfileNew": "New PHP-FPM profile",
"phpProfileId": "Profile ID", "phpProfileId": "Profile ID",
@@ -2648,13 +2649,13 @@
"cacheOnlyHits": "Show RustProxy cache diagnostics only on HIT (retain origin headers)", "cacheOnlyHits": "Show RustProxy cache diagnostics only on HIT (retain origin headers)",
"cacheDetailedStatus": "X-Cache shows STALE and REVALIDATED instead of HIT", "cacheDetailedStatus": "X-Cache shows STALE and REVALIDATED instead of HIT",
"phpHintEnabled": "Enable execution of configured script extensions through an already-running PHP-FPM, CGI runner, or FastCGI responder. The backend must be reachable.", "phpHintEnabled": "Enable execution of configured script extensions through an already-running PHP-FPM, CGI runner, or FastCGI responder. The backend must be reachable.",
"phpHintPathInfo": "Split /static.php/skins/file.css into SCRIPT_FILENAME=static.php and PATH_INFO=/skins/file.css. Useful for Roundcube; usually unnecessary for WordPress. Off by default.", "phpHintPathInfo": "Split /script.cgi/extra into SCRIPT_FILENAME=script.cgi and PATH_INFO=/extra (also available for PHP). Enable only if your application uses suffix paths. Off by default.",
"phpHintPassAuthorization": "Pass the incoming Authorization header as HTTP_AUTHORIZATION to PHP (API/Bearer/Basic authentication). Disable if not needed.", "phpHintPassAuthorization": "Pass the incoming Authorization header as HTTP_AUTHORIZATION to PHP (API/Bearer/Basic authentication). Disable if not needed.",
"phpHintExtensions": "Only these extensions are executed by the selected backend. Use php for PHP-FPM and cgi or fcgi for compatible script handlers. Unhandled script extensions are not served as static code.", "phpHintExtensions": "Only these extensions are executed by the selected backend. Use php for PHP-FPM and cgi or fcgi for compatible script handlers. Unhandled script extensions are not served as static code.",
"phpHintConnectTimeout": "PHP-FPM socket connection timeout in milliseconds: 1000 = 1 second. Range: 50–60000.", "phpHintConnectTimeout": "PHP-FPM socket connection timeout in milliseconds: 1000 = 1 second. Range: 50–60000.",
"phpHintRequestTimeout": "Timeout for the complete FastCGI request in milliseconds: 30000 = 30 seconds. Range: 100–3600000.", "phpHintRequestTimeout": "Timeout for the complete FastCGI request in milliseconds: 30000 = 30 seconds. Range: 100–3600000.",
"phpHintConcurrency": "Maximum concurrent PHP requests per service: e.g. 64. Exhaustion returns 503. Range: 1–4096.", "phpHintConcurrency": "Maximum concurrent PHP requests per service: e.g. 64. Exhaustion returns 503. Range: 1–4096.",
"phpHintBodyLimit": "Request-body limit in bytes: 67108864 = 64 MiB. 0 means no RustProxy-side limit. PHP post_max_size is separate.", "phpHintBodyLimit": "Request-body limit in bytes: 67108864 = 64 MiB. 0 means no RustProxy-side limit. PHP post_max_size applies separately.",
"phpHintHeaderLimit": "Maximum FastCGI response header length in bytes: 65536 = 64 KiB. Range: 4096–1048576.", "phpHintHeaderLimit": "Maximum FastCGI response header length in bytes: 65536 = 64 KiB. Range: 4096–1048576.",
"phpHintStderrLimit": "Maximum PHP-FPM STDERR bytes logged per request: e.g. 4096. 0 disables stderr capture (max 65536).", "phpHintStderrLimit": "Maximum PHP-FPM STDERR bytes logged per request: e.g. 4096. 0 disables stderr capture (max 65536).",
"phpHintAdminValues": "Trusted administrative INI settings, e.g. open_basedir = /var/www/webmail/:/tmp/. Use a dedicated PHP-FPM pool/socket to prevent cross-vhost INI leakage.", "phpHintAdminValues": "Trusted administrative INI settings, e.g. open_basedir = /var/www/webmail/:/tmp/. Use a dedicated PHP-FPM pool/socket to prevent cross-vhost INI leakage.",
+9 -8
View File
@@ -9,10 +9,10 @@
"webServiceStaticDeliverySection": "Dostarczanie plików statycznych", "webServiceStaticDeliverySection": "Dostarczanie plików statycznych",
"webServiceDynamicCompressionSection": "Kompresja dynamiczna", "webServiceDynamicCompressionSection": "Kompresja dynamiczna",
"webServiceSidecarsSection": "Gotowe pliki skompresowane", "webServiceSidecarsSection": "Gotowe pliki skompresowane",
"webServicePhpSourceSection": "Źródło konfiguracji i połączenie PHP-FPM", "webServicePhpSourceSection": "Źródło konfiguracji i połączenie FastCGI",
"webServicePhpRequestSection": "Obsługa żądań", "webServicePhpRequestSection": "Obsługa żądań",
"webServicePhpLimitsSection": "Limity czasu i obciążenia", "webServicePhpLimitsSection": "Limity czasu i obciążenia",
"webServicePhpOverridesSection": "Parametry FastCGI i ustawienia php.ini", "webServicePhpOverridesSection": "Parametry FastCGI i opcje PHP-FPM",
"hostIdentitySection": "Host i domeny", "hostIdentitySection": "Host i domeny",
"streamBackendConnectionSection": "Backend i obciążenie", "streamBackendConnectionSection": "Backend i obciążenie",
"streamBackendHealthSection": "Kontrola dostępności", "streamBackendHealthSection": "Kontrola dostępności",
@@ -2123,9 +2123,9 @@
"webServicePhpConnectTimeout": "Timeout połączenia (ms)", "webServicePhpConnectTimeout": "Timeout połączenia (ms)",
"webServicePhpRequestTimeout": "Łączny timeout żądania FastCGI (ms)", "webServicePhpRequestTimeout": "Łączny timeout żądania FastCGI (ms)",
"webServicePhpConcurrency": "Maks. równoległych żądań PHP", "webServicePhpConcurrency": "Maks. równoległych żądań PHP",
"webServicePhpBodyLimit": "Limit body żądania PHP (bajty, 0 = bez limitu)", "webServicePhpBodyLimit": "Limit treści żądania FastCGI (bajty, 0 = bez limitu)",
"webServicePhpHeaderLimit": "Maks. bajtów nagłówków odpowiedzi FastCGI", "webServicePhpHeaderLimit": "Maks. bajtów nagłówków odpowiedzi FastCGI",
"webServicePhpStderrLimit": "Maks. bajtów stderr PHP-FPM w logu", "webServicePhpStderrLimit": "Maks. bajtów STDERR FastCGI w logu",
"webServicePhpCustomParams": "Własne parametry FastCGI", "webServicePhpCustomParams": "Własne parametry FastCGI",
"webServicePhpCustomParamsHelp": "Jedna linia NAME = wartość, np. APP_ENV = production. Nazwy: A-Z, cyfry i podkreślenia; bez HTTP_*, PHP_VALUE, PHP_ADMIN_VALUE i podstawowych parametrów CGI.", "webServicePhpCustomParamsHelp": "Jedna linia NAME = wartość, np. APP_ENV = production. Nazwy: A-Z, cyfry i podkreślenia; bez HTTP_*, PHP_VALUE, PHP_ADMIN_VALUE i podstawowych parametrów CGI.",
"webServicePhpCustomParamsInvalid": "Własne parametry FastCGI muszą mieć unikalny format NAZWA = wartość, po jednym wpisie na linię.", "webServicePhpCustomParamsInvalid": "Własne parametry FastCGI muszą mieć unikalny format NAZWA = wartość, po jednym wpisie na linię.",
@@ -2621,13 +2621,14 @@
"locationErrorFallbackStatuses": "Przechwytywane kody statusu", "locationErrorFallbackStatuses": "Przechwytywane kody statusu",
"locationErrorFallbackHelp": "Opcjonalny fallback błędów w stylu Nginx. Wskaż ID włączonej lokalizacji wewnętrznej. Obsługiwane statusy: 403, 404, 500, 502, 503, 504.", "locationErrorFallbackHelp": "Opcjonalny fallback błędów w stylu Nginx. Wskaż ID włączonej lokalizacji wewnętrznej. Obsługiwane statusy: 403, 404, 500, 502, 503, 504.",
"webServicePhpPathInfo": "Włącz dzielenie FastCGI PATH_INFO", "webServicePhpPathInfo": "Włącz dzielenie FastCGI PATH_INFO",
"phpProfileSelect": "Konfiguracja PHP-FPM", "phpProfileSelect": "Źródło konfiguracji FastCGI",
"phpProfileLocal": "Konfiguracja lokalna", "phpProfileLocal": "Konfiguracja lokalna",
"phpProfileHelp": "Wybierz współdzielony profil FastCGI lub skonfiguruj usługę lokalnie. Zmiany profilu dotyczą wszystkich przypiętych usług.", "phpProfileHelp": "Wybierz współdzielony profil FastCGI lub skonfiguruj usługę lokalnie. Zmiany profilu dotyczą wszystkich przypiętych usług.",
"phpProfileManage": "Zarządzaj profilami FastCGI", "phpProfileManage": "Zarządzaj profilami FastCGI",
"phpProfileToolbar": "Profile FastCGI", "phpProfileToolbar": "Profile FastCGI",
"phpProfileTitle": "Wspólne profile FastCGI", "phpProfileTitle": "Wspólne profile FastCGI",
"phpProfileDescription": "Rozwiń profil, aby go zmienić. Zapis od razu aktualizuje wszystkie przypięte serwery WWW.", "phpProfileDescription": "Rozwiń profil, aby zmienić ustawienia. Zapis od razu aktualizuje wszystkie powiązane Web Service. Ustawienia php.ini są dostępne tylko dla PHP-FPM.",
"phpProfilePhpOnlySection": "Tylko PHP-FPM: ustawienia php.ini",
"phpProfileAdd": "Dodaj profil", "phpProfileAdd": "Dodaj profil",
"phpProfileNew": "Nowy profil PHP-FPM", "phpProfileNew": "Nowy profil PHP-FPM",
"phpProfileId": "ID profilu", "phpProfileId": "ID profilu",
@@ -2648,13 +2649,13 @@
"cacheOnlyHits": "Pokazuj naglowki RustProxy tylko dla HIT (zachowaj naglowki backendu)", "cacheOnlyHits": "Pokazuj naglowki RustProxy tylko dla HIT (zachowaj naglowki backendu)",
"cacheDetailedStatus": "X-Cache pokazuje STALE i REVALIDATED zamiast HIT", "cacheDetailedStatus": "X-Cache pokazuje STALE i REVALIDATED zamiast HIT",
"phpHintEnabled": "Włącz wykonywanie wybranych rozszerzeń przez już uruchomiony PHP-FPM, wykonawcę CGI lub serwer FastCGI. Backend musi być dostępny.", "phpHintEnabled": "Włącz wykonywanie wybranych rozszerzeń przez już uruchomiony PHP-FPM, wykonawcę CGI lub serwer FastCGI. Backend musi być dostępny.",
"phpHintPathInfo": "Rozdziela /static.php/skins/file.css na SCRIPT_FILENAME=static.php i PATH_INFO=/skins/file.css. Potrzebne np. w Roundcube; zwykle zbędne w WordPressie. Domyślnie wyłączone.", "phpHintPathInfo": "Dzieli URL /script.cgi/extra na SCRIPT_FILENAME=script.cgi i PATH_INFO=/extra (również dla PHP). Włącz tylko, jeśli aplikacja wymaga takiej ścieżki. Domyślnie wyłączone.",
"phpHintPassAuthorization": "Przekazuje nagłówek Authorization do PHP jako HTTP_AUTHORIZATION (np. API/Bearer/Basic). Wyłącz, gdy aplikacja go nie używa.", "phpHintPassAuthorization": "Przekazuje nagłówek Authorization do PHP jako HTTP_AUTHORIZATION (np. API/Bearer/Basic). Wyłącz, gdy aplikacja go nie używa.",
"phpHintExtensions": "Tylko te rozszerzenia uruchamia wybrany backend. Dla PHP-FPM użyj php, dla CGI/FastCGI np. cgi lub fcgi. Pozostały kod wykonywalny nie jest serwowany jako plik statyczny.", "phpHintExtensions": "Tylko te rozszerzenia uruchamia wybrany backend. Dla PHP-FPM użyj php, dla CGI/FastCGI np. cgi lub fcgi. Pozostały kod wykonywalny nie jest serwowany jako plik statyczny.",
"phpHintConnectTimeout": "Limit łączenia z gniazdem PHP-FPM w milisekundach: 1000 = 1 sekunda. Zakres: 50–60000.", "phpHintConnectTimeout": "Limit łączenia z gniazdem PHP-FPM w milisekundach: 1000 = 1 sekunda. Zakres: 50–60000.",
"phpHintRequestTimeout": "Limit całego żądania FastCGI w milisekundach: 30000 = 30 sekund. Zakres: 100–3600000.", "phpHintRequestTimeout": "Limit całego żądania FastCGI w milisekundach: 30000 = 30 sekund. Zakres: 100–3600000.",
"phpHintConcurrency": "Maksymalna liczba równoległych żądań PHP na usługę, np. 64. Przekroczenie zwraca 503. Zakres: 1–4096.", "phpHintConcurrency": "Maksymalna liczba równoległych żądań PHP na usługę, np. 64. Przekroczenie zwraca 503. Zakres: 1–4096.",
"phpHintBodyLimit": "Limit treści żądania w bajtach: 67108864 = 64 MiB. 0 = bez limitu po stronie RustProxy. PHP post_max_size jest osobny.", "phpHintBodyLimit": "Limit treści żądania w bajtach: 67108864 = 64 MiB. 0 = bez limitu po stronie RustProxy. W PHP osobno obowiązuje post_max_size.",
"phpHintHeaderLimit": "Maksymalny rozmiar nagłówków odpowiedzi FastCGI w bajtach: 65536 = 64 KiB. Zakres: 4096–1048576.", "phpHintHeaderLimit": "Maksymalny rozmiar nagłówków odpowiedzi FastCGI w bajtach: 65536 = 64 KiB. Zakres: 4096–1048576.",
"phpHintStderrLimit": "Maksymalna liczba bajtów STDERR PHP-FPM w logu na żądanie, np. 4096. 0 wyłącza przechwytywanie (maks. 65536).", "phpHintStderrLimit": "Maksymalna liczba bajtów STDERR PHP-FPM w logu na żądanie, np. 4096. 0 wyłącza przechwytywanie (maks. 65536).",
"phpHintAdminValues": "Administracyjne ustawienia INI, np. open_basedir = /var/www/webmail/:/tmp/. Aby zapobiec przeciekaniu ustawień między vhostami, stosuj osobne pule i gniazda PHP-FPM.", "phpHintAdminValues": "Administracyjne ustawienia INI, np. open_basedir = /var/www/webmail/:/tmp/. Aby zapobiec przeciekaniu ustawień między vhostami, stosuj osobne pule i gniazda PHP-FPM.",
+1
View File
@@ -123,6 +123,7 @@ fn admin_vhosts_javascript() -> &'static str {
static ASSET: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| { static ASSET: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| {
[ [
"(() => {", "(() => {",
include_str!("web/vhosts/source.js"),
include_str!("web/vhosts/core.js"), include_str!("web/vhosts/core.js"),
include_str!("web/vhosts/protocol.js"), include_str!("web/vhosts/protocol.js"),
include_str!("web/vhosts/health.js"), include_str!("web/vhosts/health.js"),
+97
View File
@@ -1668,3 +1668,100 @@ html[data-interface-icons="true"] :is(button, a, summary)>svg.ui-icon {
max-width: none; max-width: none;
overflow: visible; overflow: visible;
} }
/* Shared FastCGI profiles: keep the help text and controls inside the dialog,
including at high UI zoom and with long translated labels. */
#php-fpm-profiles-dialog {
width: calc(min(860px, 100vw - 24px) / var(--ui-scale, 1));
}
#php-fpm-profiles-dialog .location-help-content {
min-width: 0;
overflow-wrap: anywhere;
}
#php-fpm-profiles-dialog .php-profiles-description {
display: block;
max-width: 100%;
margin: 0 0 12px;
white-space: normal;
overflow-wrap: anywhere;
line-height: 1.55;
}
#php-fpm-profiles-list {
display: grid;
min-width: 0;
gap: 8px;
margin: 0 0 12px;
}
#php-fpm-profiles-list > .fastcgi-profile-card {
min-width: 0;
margin: 0;
}
#php-fpm-profiles-list .fastcgi-profile-summary {
cursor: pointer;
padding: 4px 6px;
overflow-wrap: anywhere;
}
#php-fpm-profiles-list .fastcgi-profile-title {
font-weight: 600;
}
#php-fpm-profiles-list .fastcgi-profile-handler {
display: inline-block;
margin-inline-start: 12px;
padding: 1px 6px;
border: 1px solid var(--line);
border-radius: var(--rp-radius-control, 3px);
color: var(--muted);
font-size: 10px;
}
#php-fpm-profiles-list details[open] > .fastcgi-profile-summary {
margin-bottom: 12px;
border-bottom: 1px solid var(--line);
}
#php-fpm-profiles-list .fastcgi-profile-editor {
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px;
width: 100%;
min-width: 0;
}
#php-fpm-profiles-list .fastcgi-profile-editor > label {
display: grid;
gap: 4px;
min-width: 0;
grid-row: auto;
}
#php-fpm-profiles-list .fastcgi-profile-editor > label > :is(input, select, textarea) {
width: 100%;
max-width: 100%;
min-width: 0;
}
#php-fpm-profiles-list .fastcgi-profile-editor .fastcgi-profile-php-heading {
padding-top: 6px;
border-top: 1px solid var(--line);
}
#php-fpm-profiles-list .fastcgi-profile-editor .fastcgi-profile-php-heading strong {
font-size: 12px;
}
.fastcgi-php-only-local[hidden],
#php-fpm-profiles-list .fastcgi-php-only[hidden],
#php-fpm-profiles-list .fastcgi-profile-php-heading[hidden] {
display: none !important;
}
@media (max-width: 650px) {
#php-fpm-profiles-list .fastcgi-profile-editor {
grid-template-columns: minmax(0, 1fr);
}
}
+8 -8
View File
@@ -4989,9 +4989,9 @@ curl -sS -D - -o /dev/null \
</div> </div>
<div class="vh-grid web-service-page" data-web-service-page="php" hidden> <div class="vh-grid web-service-page" data-web-service-page="php" hidden>
<section class="vh-wide vh-setting-section web-service-setting-section"> <section class="vh-wide vh-setting-section web-service-setting-section">
<h3 data-i18n="webServicePhpSourceSection">FastCGI / PHP-FPM source and endpoint</h3> <h3 data-i18n="webServicePhpSourceSection">FastCGI configuration source and endpoint</h3>
<div class="vh-grid"> <div class="vh-grid">
<label class="vh-wide"><span data-i18n="phpProfileSelect">PHP-FPM configuration <label class="vh-wide"><span data-i18n="phpProfileSelect">FastCGI configuration
source</span> source</span>
<select id="web-service-php-profile"> <select id="web-service-php-profile">
<option value="" data-i18n="phpProfileLocal">Local configuration</option> <option value="" data-i18n="phpProfileLocal">Local configuration</option>
@@ -5094,7 +5094,7 @@ curl -sS -D - -o /dev/null \
class="fine" data-i18n="phpHintConcurrency">Max simultaneous PHP requests for this class="fine" data-i18n="phpHintConcurrency">Max simultaneous PHP requests for this
service; service;
e.g. 64. Exhaustion returns 503 (1–4096).</small></label> e.g. 64. Exhaustion returns 503 (1–4096).</small></label>
<label><span data-i18n="webServicePhpBodyLimit">PHP request body limit (bytes, 0 = <label><span data-i18n="webServicePhpBodyLimit">FastCGI request body limit (bytes, 0 =
unlimited)</span><input id="web-service-php-body-limit" min="0" max="8589934592" unlimited)</span><input id="web-service-php-body-limit" min="0" max="8589934592"
step="1" type="number" /><small class="fine" data-i18n="phpHintBodyLimit">Bytes, not step="1" type="number" /><small class="fine" data-i18n="phpHintBodyLimit">Bytes, not
MB: 67108864 = MB: 67108864 =
@@ -5104,7 +5104,7 @@ curl -sS -D - -o /dev/null \
step="1" type="number" /><small class="fine" data-i18n="phpHintHeaderLimit">Max PHP step="1" type="number" /><small class="fine" data-i18n="phpHintHeaderLimit">Max PHP
response-header size in bytes; default response-header size in bytes; default
65536 = 64 KiB (4096–1048576).</small></label> 65536 = 64 KiB (4096–1048576).</small></label>
<label><span data-i18n="webServicePhpStderrLimit">Max PHP-FPM stderr log bytes</span><input <label><span data-i18n="webServicePhpStderrLimit">Max FastCGI stderr log bytes</span><input
id="web-service-php-stderr-limit" min="0" max="65536" step="1" id="web-service-php-stderr-limit" min="0" max="65536" step="1"
type="number" /><small class="fine" data-i18n="phpHintStderrLimit">Max FastCGI type="number" /><small class="fine" data-i18n="phpHintStderrLimit">Max FastCGI
STDERR bytes kept per request; e.g. STDERR bytes kept per request; e.g.
@@ -5112,7 +5112,7 @@ curl -sS -D - -o /dev/null \
</div> </div>
</section> </section>
<section class="vh-wide vh-setting-section web-service-setting-section"> <section class="vh-wide vh-setting-section web-service-setting-section">
<h3 data-i18n="webServicePhpOverridesSection">FastCGI and php.ini overrides</h3> <h3 data-i18n="webServicePhpOverridesSection">FastCGI parameters and PHP-FPM options</h3>
<div class="vh-grid"> <div class="vh-grid">
<label class="vh-wide"><span data-i18n="webServicePhpCustomParams">Custom FastCGI <label class="vh-wide"><span data-i18n="webServicePhpCustomParams">Custom FastCGI
parameters</span><textarea id="web-service-php-custom-params" maxlength="65536" parameters</span><textarea id="web-service-php-custom-params" maxlength="65536"
@@ -5121,7 +5121,7 @@ curl -sS -D - -o /dev/null \
data-i18n="webServicePhpCustomParamsHelp">One NAME = value entry per line. data-i18n="webServicePhpCustomParamsHelp">One NAME = value entry per line.
Static trusted values only; core CGI, HTTP_* and PHP_* control names are Static trusted values only; core CGI, HTTP_* and PHP_* control names are
reserved. Example: APP_ENV = production; no variable interpolation.</small></label> reserved. Example: APP_ENV = production; no variable interpolation.</small></label>
<label class="vh-wide"><span data-i18n="webServicePhpValues">PHP INI overrides <label class="vh-wide fastcgi-php-only-local"><span data-i18n="webServicePhpValues">PHP INI overrides
(PHP_VALUE)</span><textarea id="web-service-php-values" maxlength="65536" rows="6" (PHP_VALUE)</span><textarea id="web-service-php-values" maxlength="65536" rows="6"
spellcheck="false" spellcheck="false"
placeholder="memory_limit = 256M&#10;upload_max_filesize = 64M&#10;post_max_size = 64M"></textarea><small placeholder="memory_limit = 256M&#10;upload_max_filesize = 64M&#10;post_max_size = 64M"></textarea><small
@@ -5130,7 +5130,7 @@ curl -sS -D - -o /dev/null \
Examples: memory_limit = 256M, upload_max_filesize = 64M, post_max_size = 64M, Examples: memory_limit = 256M, upload_max_filesize = 64M, post_max_size = 64M,
max_execution_time = 30. Use PHP_ADMIN_VALUE for operator-only max_execution_time = 30. Use PHP_ADMIN_VALUE for operator-only
settings.</small></label> settings.</small></label>
<label class="vh-wide"><span data-i18n="phpProfileAdminValues">PHP administrator INI <label class="vh-wide fastcgi-php-only-local"><span data-i18n="phpProfileAdminValues">PHP administrator INI
overrides overrides
(PHP_ADMIN_VALUE)</span><textarea id="web-service-php-admin-values" (PHP_ADMIN_VALUE)</span><textarea id="web-service-php-admin-values"
maxlength="65536" rows="6" spellcheck="false" maxlength="65536" rows="6" spellcheck="false"
@@ -5179,7 +5179,7 @@ curl -sS -D - -o /dev/null \
<button type="button" class="outline" id="php-fpm-profiles-close" data-i18n="close">Close</button> <button type="button" class="outline" id="php-fpm-profiles-close" data-i18n="close">Close</button>
</div> </div>
<div class="card location-help-content"> <div class="card location-help-content">
<p class="fine" data-i18n="phpProfileDescription">Expand a profile to edit it. Changes are saved immediately <p class="fine php-profiles-description" data-i18n="phpProfileDescription">Expand a profile to edit it. Changes are saved immediately
and shared by every attached Web Service.</p> and shared by every attached Web Service.</p>
<div id="php-fpm-profiles-list"></div> <div id="php-fpm-profiles-list"></div>
<button type="button" class="outline" id="php-fpm-profile-add" data-i18n="phpProfileAdd">Add <button type="button" class="outline" id="php-fpm-profile-add" data-i18n="phpProfileAdd">Add
+2 -2
View File
@@ -616,12 +616,12 @@ function collect() {
const bindingSelection = readBindings(); const bindingSelection = readBindings();
const mainSourceType = str("source-type"); const mainSourceType = str("source-type");
const mainFallbackTarget = str("main-error-target"), mainFallbackStatuses = lines(str("main-error-statuses")).map(value => Number(value)); const mainFallbackTarget = str("main-error-target"), mainFallbackStatuses = lines(str("main-error-statuses")).map(value => Number(value));
const needsProxy = mainSourceType === "reverse_proxy" || paths.some(route => !route.response && (route.source?.type || "reverse_proxy") === "reverse_proxy"); const needsProxy = vhostRequiresProxy({ source: { type: mainSourceType }, routes: paths });
if (!bindingSelection.length) throw new Error(t("vhListenerRequired")); if (!bindingSelection.length) throw new Error(t("vhListenerRequired"));
if (needsProxy && !members.length) throw new Error(t("vhBackendRequired")); if (needsProxy && !members.length) throw new Error(t("vhBackendRequired"));
if (yes("www-redirect") && !str("www-redirect-target")) throw new Error(t("vhWwwNoHosts")); if (yes("www-redirect") && !str("www-redirect-target")) throw new Error(t("vhWwwNoHosts"));
if (mainSourceType === "web_server" && !str("source-web-service")) throw new Error(t("webServiceRequired")); if (mainSourceType === "web_server" && !str("source-web-service")) throw new Error(t("webServiceRequired"));
if (paths.some(route => !route.response && route.source?.type === "web_server" && !route.source.web_service_id)) throw new Error(t("webServiceRequired")); if (paths.some(route => !route.response && !route.redirect && route.source?.type === "web_server" && !route.source.web_service_id)) throw new Error(t("webServiceRequired"));
if (yes("force-ssl")) { if (yes("force-ssl")) {
const tlsPorts = new Set(); let tlsSelected = false, httpSelected = false; const tlsPorts = new Set(); let tlsSelected = false, httpSelected = false;
for (const id of bindingSelection) { for (const id of bindingSelection) {
+6 -6
View File
@@ -602,7 +602,7 @@ function render() {
if (!initialized) load(defaults(), [], false); if (!initialized) load(defaults(), [], false);
const config = envelope.config; const config = envelope.config;
const configuredHasProxySource = (config.vhosts || []).some(vhost => const configuredHasProxySource = (config.vhosts || []).some(vhost =>
vhost.source?.type !== "web_server" || (vhost.routes || []).some(route => !route.response && (route.source?.type || "reverse_proxy") === "reverse_proxy") vhostRequiresProxy(vhost)
); );
const diagnosticsCard = $("backend-diagnostics-card"); const diagnosticsCard = $("backend-diagnostics-card");
diagnosticsCard?.classList.toggle("is-no-proxy", !configuredHasProxySource); diagnosticsCard?.classList.toggle("is-no-proxy", !configuredHasProxySource);
@@ -677,7 +677,7 @@ function render() {
["vhAclProfile", v.acl_profile_id ? ((config.acl_profiles || []).find(profile => profile.id === v.acl_profile_id)?.name || v.acl_profile_id) : t("vhAclProfileNone")], ["vhAclProfile", v.acl_profile_id ? ((config.acl_profiles || []).find(profile => profile.id === v.acl_profile_id)?.name || v.acl_profile_id) : t("vhAclProfileNone")],
["cache", v.cache?.enabled === true ? t("enabled") : v.cache?.enabled === false ? t("notEnabled") : t("inherit")], ["cache", v.cache?.enabled === true ? t("enabled") : v.cache?.enabled === false ? t("notEnabled") : t("inherit")],
["vhBackendPool", v.source?.type === "web_server" ["vhBackendPool", v.source?.type === "web_server"
? ((v.routes || []).some(route => !route.response && (route.source?.type || "reverse_proxy") === "reverse_proxy") && (v.backends || []).length ? ((v.routes || []).some(locationRequiresProxy) && (v.backends || []).length
? `${t("webServer")} + ${(v.backends || []).length}` ? `${t("webServer")} + ${(v.backends || []).length}`
: t("webServer")) : t("webServer"))
: `${(v.backends || []).length}`], : `${(v.backends || []).length}`],
@@ -701,7 +701,7 @@ function render() {
box.append(live); box.append(live);
const chart = el("div", undefined, "vhost-chart"); const chartHead = el("div", undefined, "vhost-chart-head"); chartHead.append(text("span", "vhLifetimeChart", "small-label")); const chartValue = el("span", "-", "fine"); chartValue.dataset.chartValueFor = v.id; chartHead.append(chartValue); chart.append(chartHead); const chart = el("div", undefined, "vhost-chart"); const chartHead = el("div", undefined, "vhost-chart-head"); chartHead.append(text("span", "vhLifetimeChart", "small-label")); const chartValue = el("span", "-", "fine"); chartValue.dataset.chartValueFor = v.id; chartHead.append(chartValue); chart.append(chartHead);
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); svg.setAttribute("viewBox", "0 0 320 54"); svg.setAttribute("preserveAspectRatio", "none"); svg.dataset.chartFor = v.id; svg.setAttribute("aria-label", t("vhLifetimeChart")); const polyline = document.createElementNS("http://www.w3.org/2000/svg", "polyline"); polyline.setAttribute("class", "vhost-chart-line"); svg.append(polyline); chart.append(svg); box.append(chart); const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); svg.setAttribute("viewBox", "0 0 320 54"); svg.setAttribute("preserveAspectRatio", "none"); svg.dataset.chartFor = v.id; svg.setAttribute("aria-label", t("vhLifetimeChart")); const polyline = document.createElementNS("http://www.w3.org/2000/svg", "polyline"); polyline.setAttribute("class", "vhost-chart-line"); svg.append(polyline); chart.append(svg); box.append(chart);
const hasProxySource = v.source?.type !== "web_server" || (v.routes || []).some(route => !route.response && (route.source?.type || "reverse_proxy") === "reverse_proxy"); const hasProxySource = vhostRequiresProxy(v);
if (hasProxySource) { if (hasProxySource) {
const health = el("p", t("vhHealthEmpty"), "vh-health-summary"); health.dataset.healthFor = v.id; box.append(health); const health = el("p", t("vhHealthEmpty"), "vh-health-summary"); health.dataset.healthFor = v.id; box.append(health);
} }
@@ -839,7 +839,7 @@ function renderStatus(status) {
for (const [id, vhost] of configuredVhosts) { for (const [id, vhost] of configuredVhosts) {
const existing = aggregate.get(id) || {}; const existing = aggregate.get(id) || {};
const metrics = status.vhost_metrics?.[id]; const metrics = status.vhost_metrics?.[id];
const hasProxySource = vhost.source?.type !== "web_server" || (vhost.routes || []).some(route => !route.response && (route.source?.type || "reverse_proxy") === "reverse_proxy"); const hasProxySource = vhostRequiresProxy(vhost);
const disabled = vhost.enabled === false; const disabled = vhost.enabled === false;
aggregate.set(id, { aggregate.set(id, {
...existing, ...existing,
@@ -858,7 +858,7 @@ function renderStatus(status) {
} }
for (const key of vhostTrafficHistory.keys()) if (!seenVhostTraffic.has(key)) vhostTrafficHistory.delete(key); for (const key of vhostTrafficHistory.keys()) if (!seenVhostTraffic.has(key)) vhostTrafficHistory.delete(key);
const hasConfiguredProxySource = [...configuredVhosts.values()].some(vhost => const hasConfiguredProxySource = [...configuredVhosts.values()].some(vhost =>
vhost.source?.type !== "web_server" || (vhost.routes || []).some(route => !route.response && (route.source?.type || "reverse_proxy") === "reverse_proxy") vhostRequiresProxy(vhost)
); );
if (buildPoolRows) $("pool-rows").replaceChildren(...rows); else overviewViewsPending = true; if (buildPoolRows) $("pool-rows").replaceChildren(...rows); else overviewViewsPending = true;
renderBackendOverview(overviewItems, hasConfiguredProxySource, status, false); renderBackendOverview(overviewItems, hasConfiguredProxySource, status, false);
@@ -900,7 +900,7 @@ function renderStatus(status) {
} }
} }
const editingVhost = editing ? configuredVhosts.get(editing) : null; const editingVhost = editing ? configuredVhosts.get(editing) : null;
const editingHasProxy = editingVhost && (editingVhost.source?.type !== "web_server" || (editingVhost.routes || []).some(route => !route.response && (route.source?.type || "reverse_proxy") === "reverse_proxy")); const editingHasProxy = editingVhost && vhostRequiresProxy(editingVhost);
$("vhost-health-live").hidden = !!editingVhost && !editingHasProxy; $("vhost-health-live").hidden = !!editingVhost && !editingHasProxy;
$("vhost-health-live").textContent = editing ? (editingHasProxy ? (summaries.get(editing) || t("vhHealthEmpty")) : "") : t("vhNewHealthHint"); $("vhost-health-live").textContent = editing ? (editingHasProxy ? (summaries.get(editing) || t("vhHealthEmpty")) : "") : t("vhNewHealthHint");
} }
+14
View File
@@ -0,0 +1,14 @@
"use strict";
// A local redirect or response terminates in RustProxy and never connects to an
// upstream. Disabled custom locations do not create a live backend dependency.
// Keep these checks aligned with Vhost::validate and config/routing.rs.
function locationRequiresProxy(route) {
return route.enabled !== false
&& !route.response
&& !route.redirect
&& (route.source?.type || "reverse_proxy") === "reverse_proxy";
}
function vhostRequiresProxy(vhost) {
return (vhost.source?.type || "reverse_proxy") === "reverse_proxy"
|| (vhost.routes || []).some(locationRequiresProxy);
}
+40 -12
View File
@@ -12,8 +12,8 @@ window.rustProxyPhpProfiles = ({ defaults, mapLines, lines, parseFastCgiParams,
const profileFields = [ const profileFields = [
["enabled", "webServicePhpEnabled", "checkbox"], ["enabled", "webServicePhpEnabled", "checkbox"],
["endpoint", "webServicePhpEndpoint", "text"],
["handler", "webServiceFastCgiHandler", "select"], ["handler", "webServiceFastCgiHandler", "select"],
["endpoint", "webServicePhpEndpoint", "text"],
["script_name_prefix", "webServiceFastCgiScriptPrefix", "text"], ["script_name_prefix", "webServiceFastCgiScriptPrefix", "text"],
["extensions", "webServicePhpExtensions", "text"], ["extensions", "webServicePhpExtensions", "text"],
["path_info", "webServicePhpPathInfo", "checkbox"], ["path_info", "webServicePhpPathInfo", "checkbox"],
@@ -41,10 +41,13 @@ window.rustProxyPhpProfiles = ({ defaults, mapLines, lines, parseFastCgiParams,
}; };
function profileEditor(profile, creating = false) { function profileEditor(profile, creating = false) {
const details = document.createElement("details"); details.className = "card"; const details = document.createElement("details"); details.className = "card fastcgi-profile-card";
if (creating) details.open = true; if (creating) details.open = true;
const summary = el("summary", profile.name || profile.id || t("phpProfileNew")); const summary = el("summary", undefined, "fastcgi-profile-summary");
const editor = document.createElement("form"); editor.className = "vh-grid"; editor.noValidate = true; const title = el("span", profile.name || profile.id || t("phpProfileNew"), "fastcgi-profile-title");
const kindBadge = el("span", "", "fastcgi-profile-handler");
summary.append(title, kindBadge);
const editor = document.createElement("form"); editor.className = "vh-grid fastcgi-profile-editor"; editor.noValidate = true;
const namedInput = (key, value, readonly = false) => { const namedInput = (key, value, readonly = false) => {
const wrapper = el("label"); const wrapper = el("label");
wrapper.append(el("span", t(key))); wrapper.append(el("span", t(key)));
@@ -54,10 +57,21 @@ window.rustProxyPhpProfiles = ({ defaults, mapLines, lines, parseFastCgiParams,
const idInput = namedInput("phpProfileId", profile.id, !creating); const idInput = namedInput("phpProfileId", profile.id, !creating);
const nameInput = namedInput("phpProfileName", profile.name); const nameInput = namedInput("phpProfileName", profile.name);
const controls = {}; const controls = {};
const phpOnlyWrappers = [];
let phpOnlySection;
for (const [key, label, kind, min, max] of profileFields) { for (const [key, label, kind, min, max] of profileFields) {
if (key === "php_values") {
phpOnlySection = el("div", undefined, "vh-wide fastcgi-profile-php-heading");
phpOnlySection.append(el("strong", t("phpProfilePhpOnlySection")));
editor.append(phpOnlySection);
}
const toggle = kind === "checkbox"; const toggle = kind === "checkbox";
const wrapper = toggle ? el("div", undefined, "php-switch-row vh-wide") : el("label"); const wrapper = toggle ? el("div", undefined, "php-switch-row vh-wide") : el("label");
if (!toggle && kind === "textarea") wrapper.className = "vh-wide"; if (!toggle && kind === "textarea") wrapper.className = "vh-wide";
if (key === "php_values" || key === "php_admin_values") {
wrapper.classList.add("fastcgi-php-only");
phpOnlyWrappers.push(wrapper);
}
const labelEl = toggle ? el("label", undefined, "check php-switch-label") : wrapper; const labelEl = toggle ? el("label", undefined, "check php-switch-label") : wrapper;
const input = document.createElement(kind === "textarea" ? "textarea" : kind === "select" ? "select" : "input"); const input = document.createElement(kind === "textarea" ? "textarea" : kind === "select" ? "select" : "input");
if (kind !== "textarea" && kind !== "select") input.type = kind; if (kind !== "textarea" && kind !== "select") input.type = kind;
@@ -94,6 +108,18 @@ window.rustProxyPhpProfiles = ({ defaults, mapLines, lines, parseFastCgiParams,
editor.append(wrapper); controls[key] = input; editor.append(wrapper); controls[key] = input;
} }
const handlerSelector = controls.handler; const handlerSelector = controls.handler;
const syncHandler = () => {
const kind = handlerSelector.value;
const phpFpm = kind === "php_fpm";
const caption = { php_fpm: "PHP-FPM", fcgiwrap: "fcgiwrap", fastcgi: "FastCGI" };
kindBadge.textContent = caption[kind] || "FastCGI";
for (const wrapper of phpOnlyWrappers) wrapper.hidden = !phpFpm;
phpOnlySection.hidden = !phpFpm;
controls.php_values.disabled = !phpFpm;
controls.php_admin_values.disabled = !phpFpm;
controls.endpoint.placeholder = kind === "fcgiwrap" ? "unix:/run/fcgiwrap.socket" : kind === "fastcgi" ? "tcp:127.0.0.1:9001" : "unix:/run/php/php-fpm.sock";
controls.extensions.placeholder = kind === "fcgiwrap" ? "cgi, pl" : kind === "fastcgi" ? "fcgi" : "php, phtml";
};
handlerSelector.addEventListener("change", () => { handlerSelector.addEventListener("change", () => {
const kind = handlerSelector.value; const kind = handlerSelector.value;
if (kind !== "php_fpm" && controls.extensions.value.trim().toLowerCase() === "php") { if (kind !== "php_fpm" && controls.extensions.value.trim().toLowerCase() === "php") {
@@ -104,15 +130,12 @@ window.rustProxyPhpProfiles = ({ defaults, mapLines, lines, parseFastCgiParams,
if (kind === "fcgiwrap" && controls.endpoint.value === "unix:/run/php/php-fpm.sock") { if (kind === "fcgiwrap" && controls.endpoint.value === "unix:/run/php/php-fpm.sock") {
controls.endpoint.value = "unix:/run/fcgiwrap.socket"; controls.endpoint.value = "unix:/run/fcgiwrap.socket";
} }
if (kind !== "php_fpm") { if (kind === "php_fpm" && controls.endpoint.value === "unix:/run/fcgiwrap.socket") {
controls.php_values.value = ""; controls.endpoint.value = "unix:/run/php/php-fpm.sock";
controls.php_admin_values.value = "";
} }
controls.php_values.disabled = kind !== "php_fpm"; syncHandler();
controls.php_admin_values.disabled = kind !== "php_fpm";
}); });
controls.php_values.disabled = handlerSelector.value !== "php_fpm"; syncHandler();
controls.php_admin_values.disabled = handlerSelector.value !== "php_fpm";
const actions = el("div", undefined, "form-actions vh-wide"); const actions = el("div", undefined, "form-actions vh-wide");
const save = el("button", t("apply"), "primary"); save.type = "submit"; const save = el("button", t("apply"), "primary"); save.type = "submit";
actions.append(save); actions.append(save);
@@ -138,8 +161,13 @@ window.rustProxyPhpProfiles = ({ defaults, mapLines, lines, parseFastCgiParams,
kind === "checkbox" ? controls[key].checked : kind === "number" ? Number(controls[key].value) : kind === "checkbox" ? controls[key].checked : kind === "number" ? Number(controls[key].value) :
key === "extensions" ? lines(controls[key].value).map(item => item.replace(/^\./, "").toLowerCase()) : key === "extensions" ? lines(controls[key].value).map(item => item.replace(/^\./, "").toLowerCase()) :
key === "custom_params" ? parseFastCgiParams(controls[key].value) : key === "custom_params" ? parseFastCgiParams(controls[key].value) :
key === "php_values" || key === "php_admin_values" ? parsePhpValues(controls[key].value) : controls[key].value.trim() key === "php_values" || key === "php_admin_values" ?
handlerSelector.value === "php_fpm" ? parsePhpValues(controls[key].value) : {} : controls[key].value.trim()
])); ]));
if (php.handler !== "php_fpm") {
php.php_values = {};
php.php_admin_values = {};
}
validatePhpCustomData(php.custom_params, php.php_values, php.php_admin_values); validatePhpCustomData(php.custom_params, php.php_values, php.php_admin_values);
const next = structuredClone(envelope.config.php_fpm_profiles || []); const next = structuredClone(envelope.config.php_fpm_profiles || []);
if (next.some(item => item.id === id && (creating || item.id !== profile.id))) throw new Error(t("phpProfileDuplicate")); if (next.some(item => item.id === id && (creating || item.id !== profile.id))) throw new Error(t("phpProfileDuplicate"));
+9 -6
View File
@@ -171,7 +171,11 @@
const attached = !!$("web-service-php-profile").value; const attached = !!$("web-service-php-profile").value;
const enabled = $("web-service-php-enabled").checked; const enabled = $("web-service-php-enabled").checked;
$("web-service-php-enabled").disabled = attached; $("web-service-php-enabled").disabled = attached;
const phpFpm = $("web-service-php-handler").value === "php_fpm"; const selectedProfile = attached
? (envelope?.config.php_fpm_profiles || []).find(profile => profile.id === $("web-service-php-profile").value)
: null;
const phpFpm = (selectedProfile?.php?.handler || $("web-service-php-handler").value) === "php_fpm";
for (const item of document.querySelectorAll(".fastcgi-php-only-local")) item.hidden = !phpFpm;
$("web-service-php-values").disabled = !enabled || attached || !phpFpm; $("web-service-php-values").disabled = !enabled || attached || !phpFpm;
$("web-service-php-admin-values").disabled = !enabled || attached || !phpFpm; $("web-service-php-admin-values").disabled = !enabled || attached || !phpFpm;
@@ -560,8 +564,8 @@
max_response_header_bytes: Number($("web-service-php-header-limit").value || 65536), max_response_header_bytes: Number($("web-service-php-header-limit").value || 65536),
stderr_log_bytes: Number($("web-service-php-stderr-limit").value || 0), stderr_log_bytes: Number($("web-service-php-stderr-limit").value || 0),
custom_params: parseFastCgiParams($("web-service-php-custom-params").value), custom_params: parseFastCgiParams($("web-service-php-custom-params").value),
php_values: parsePhpValues($("web-service-php-values").value), php_values: $("web-service-php-handler").value === "php_fpm" ? parsePhpValues($("web-service-php-values").value) : {},
php_admin_values: parsePhpValues($("web-service-php-admin-values").value) php_admin_values: $("web-service-php-handler").value === "php_fpm" ? parsePhpValues($("web-service-php-admin-values").value) : {}
} }
}; };
validatePhpCustomData(item.php.custom_params, item.php.php_values, item.php.php_admin_values); validatePhpCustomData(item.php.custom_params, item.php.php_values, item.php.php_admin_values);
@@ -595,9 +599,8 @@
if (kind === "fcgiwrap" && endpoint.value === "unix:/run/php/php-fpm.sock") { if (kind === "fcgiwrap" && endpoint.value === "unix:/run/php/php-fpm.sock") {
endpoint.value = "unix:/run/fcgiwrap.socket"; endpoint.value = "unix:/run/fcgiwrap.socket";
} }
if (kind !== "php_fpm") { if (kind === "php_fpm" && endpoint.value === "unix:/run/fcgiwrap.socket") {
$("web-service-php-values").value = ""; endpoint.value = "unix:/run/php/php-fpm.sock";
$("web-service-php-admin-values").value = "";
} }
syncPhp(); syncPhp();
}); });
+38
View File
@@ -327,3 +327,41 @@ mod timing_allow_origin_tests {
} }
} }
} }
mod local_web_service_redirect_tests {
use super::Vhost;
use serde_json::json;
#[test]
fn web_service_with_local_redirect_does_not_require_proxy_backend() {
let mut host: Vhost = serde_json::from_value(json!({
"id": "web-with-redirect",
"frontend": { "hosts": ["example.test"], "listener_ids": ["http"] },
"source": { "type": "web_server", "web_service_id": "site" },
"routes": [
{
"id": "root-redirect", "match_type": "exact", "path_prefix": "/",
"source": { "type": "reverse_proxy" },
"redirect": { "status": 302, "target": "https://example.test/app/" }
},
{
"id": "local-error", "match_type": "exact", "path_prefix": "/maintenance",
"source": { "type": "reverse_proxy" },
"response": { "status": 503, "body": "Maintenance" }
}
]
}))
.unwrap();
assert!(host.validate().is_ok(), "local actions require no backend");
host.routes.push(serde_json::from_value(json!({
"id": "unused-proxy", "path_prefix": "/disabled/", "enabled": false,
"source": { "type": "reverse_proxy" }
})).unwrap());
assert!(host.validate().is_ok(), "disabled proxy route needs no backend");
host.routes.last_mut().unwrap().enabled = true;
assert!(host.validate().unwrap_err().to_string().contains("backend"),
"an active reverse-proxy route still requires a backend");
}
}