From db388a3e4e580151f68568b1901d3aef197e300f Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Sat, 10 Nov 2018 07:58:56 +0300 Subject: improved nginx locations --- configs/nginx/nginx.conf | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/configs/nginx/nginx.conf b/configs/nginx/nginx.conf index b6aa1eaf..ecc93b79 100644 --- a/configs/nginx/nginx.conf +++ b/configs/nginx/nginx.conf @@ -93,7 +93,8 @@ http { #PROD ngx.exec("/wsauth"); #PROD end #PROD } - rewrite /kvmd/ws /ws break; + rewrite ^/kvmd/ws$ /ws break; + rewrite ^/kvmd/ws\?(.*)$ /ws?$1 break; proxy_pass http://kvmd; include /etc/nginx/proxy-params.conf; proxy_set_header Upgrade $http_upgrade; @@ -104,7 +105,8 @@ http { } location /kvmd/msd/write { - rewrite /kvmd/msd/write /msd/write break; + rewrite ^/kvmd/msd/write$ /msd/write break; + rewrite ^/kvmd/msd/write\?(.*)$ /msd/write?$1 break; proxy_pass http://kvmd; include /etc/nginx/proxy-params.conf; limit_rate 6250k; @@ -114,7 +116,8 @@ http { } location /kvmd/log { - rewrite /kvmd/log /log break; + rewrite ^/kvmd/log$ /log break; + rewrite ^/kvmd/log\?(.*)$ /log?$1 break; proxy_pass http://kvmd; include /etc/nginx/proxy-params.conf; proxy_read_timeout 7d; @@ -124,13 +127,16 @@ http { } location /kvmd { - rewrite /kvmd/?(.*) /$1 break; + rewrite ^/kvmd$ / break; + rewrite ^/kvmd/(.*)$ /$1 break; proxy_pass http://kvmd; include /etc/nginx/proxy-params.conf; } location /streamer { - rewrite /streamer/?(.*) /$1 break; + rewrite ^/streamer$ / break; + rewrite ^/streamer\?(.*)$ ?$1 break; + rewrite ^/streamer/(.*)$ /$1 break; proxy_pass http://ustreamer; include /etc/nginx/proxy-params.conf; postpone_output 0; -- cgit v1.2.3