From 02fc4b5b387002abe28fad4f822d605c97303d24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <michael@minelli.me> Date: Mon, 28 Aug 2023 18:20:41 +0200 Subject: [PATCH] Proxy => Modify configuration for not rewrite encoded path --- Proxy/default.conf | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Proxy/default.conf b/Proxy/default.conf index 7debefe..d8bab19 100644 --- a/Proxy/default.conf +++ b/Proxy/default.conf @@ -28,8 +28,14 @@ server { large_client_header_buffers 4 1024k; client_max_body_size 100M; + resolver 127.0.0.11; + location /dojo/ { - proxy_pass http://dojo-frontend/; + rewrite ^ $request_uri; + rewrite ^/dojo(/.*) $1 break; + return 400; + proxy_pass http://dojo-frontend$uri; + proxy_intercept_errors on; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -41,8 +47,11 @@ server { } location /dojo/api/ { - proxy_pass http://dojo-api:30992/; - rewrite ^/api(/.*)$ $1 break; + rewrite ^ $request_uri; + rewrite ^/dojo/api(/.*) $1 break; + return 400; + proxy_pass http://dojo-api:30992$uri; + proxy_intercept_errors on; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -54,8 +63,11 @@ server { } location /dojo/adminer/ { - proxy_pass http://adminer:8080/; - rewrite ^/adminer(/.*)$ $1 break; + rewrite ^ $request_uri; + rewrite ^/dojo/adminer(/.*) $1 break; + return 400; + proxy_pass http://adminer:8080$uri; + proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_intercept_errors on; -- GitLab