Closed lukasbableck closed 1 year ago
This requires some deep work in the nginx-custom-config merge process. The cause it not the replacers but the curly brackets itself being opening and closing blocks. We'll see what we can do
Could you test the following patch and check whether it works as intended?
diff --git a/lib/Froxlor/Cron/Http/Nginx.php b/lib/Froxlor/Cron/Http/Nginx.php
index 76ad0471..c0cf4749 100644
--- a/lib/Froxlor/Cron/Http/Nginx.php
+++ b/lib/Froxlor/Cron/Http/Nginx.php
@@ -883,13 +883,7 @@ class Nginx extends HttpConfigBase
// remove comments
$vhost = implode("\n", preg_replace('/^(\s+)?#(.*)$/', '', explode("\n", $vhost)));
// Break blocks into lines
- $vhost = str_replace([
- "{",
- "}"
- ], [
- " {\n",
- "\n}"
- ], $vhost);
+ $vhost = preg_replace("/^(\s+)location(.+)\{(.+)\}$/misU", "location $2 {\n $3 \n}", $vhost);
// Break into array items
$vhost = explode("\n", preg_replace('/[ \t]+/', ' ', trim(preg_replace('/\t+/', '', $vhost))));
// Remove empty lines
Yes, seems to work fine.
fixed in 9d0e463906c4f2df3ac39aafdca2737260d2e433
Describe the bug If a rewrite in the vHost settings for a domain contains curly braces Froxlor seems to add whitespace around those braces, obviously breaking the rewrite.
This
results in
System information
To Reproduce Steps to reproduce the behavior:
Expected behavior No whitespaces before and after curly braces if they are part of a string