From 76c88940de3c2155a43ac1c3ad7e452b13670cba Mon Sep 17 00:00:00 2001 From: Robbie Ferguson Date: Thu, 21 Aug 2025 19:45:18 +0000 Subject: [PATCH] Fix escapes in nginx config output --- installer.sh | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/installer.sh b/installer.sh index ab34e0c..478b864 100755 --- a/installer.sh +++ b/installer.sh @@ -204,41 +204,35 @@ server { add_header X-Content-Type-Options nosniff; - # Redirect root to Main_Page (pretty URL) location = / { return 302 /wiki/Main_Page; } - # Pretty URL support: /wiki/Title location /wiki/ { - try_files $uri $uri/ @rewrite; + try_files \$uri \$uri/ @rewrite; } location @rewrite { - rewrite ^/wiki/(.*)$ /index.php?title=$1&$args; + rewrite ^/wiki/(.*)\$ /index.php?title=\$1&\$args; } - # Block direct access to maintenance scripts location ^~ /maintenance/ { return 403; } - # Handle PHP files - location ~ \.php$ { + location ~ \.php\$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php-fpm.sock; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; include fastcgi_params; } - # Static content caching - location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|ttf|woff|woff2)$ { - try_files $uri /index.php; + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|ttf|woff|woff2)\$ { + try_files \$uri /index.php; expires max; log_not_found off; } - # Redirect /activate to /activate/ location = /activate { return 301 /activate/; } @@ -248,7 +242,7 @@ server { listen 80 default_server; listen [::]:80 default_server; server_name _; - return 301 https://$host$request_uri; + return 301 https://\$host\$request_uri; } EOF