From cfffbe9472e093a1ed91c2902553c0db27b90cd6 Mon Sep 17 00:00:00 2001 From: Andrew Rowson Date: Mon, 28 Jun 2021 12:36:16 +0100 Subject: [PATCH] Add trailing slashes to location blocks (#63) On my configuration, having a trailing slash on `proxy_pass` but not on the location block causes the sub-path after the `location` to be appended to the `proxy_pass` url, causing a double-forward-slash. E.g. going to `/api/0/list` actually ends up making a call to the proxy of `http://otrecorder/api//0/list`, which fails for me. --- docker/nginx.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/nginx.tmpl b/docker/nginx.tmpl index 1f1ed8e..e96e753 100644 --- a/docker/nginx.tmpl +++ b/docker/nginx.tmpl @@ -10,10 +10,10 @@ http { listen ${LISTEN_PORT}; listen [::]:${LISTEN_PORT}; root /usr/share/nginx/html; - location /api { + location /api/ { proxy_pass http://otrecorder/api/; } - location /ws { + location /ws/ { proxy_pass http://otrecorder/ws/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade;