From 30792c3e3f5ec3994625fe98189e0edfd1342d4b Mon Sep 17 00:00:00 2001 From: Yuchan Lee Date: Fri, 5 Apr 2024 20:51:28 +0900 Subject: [PATCH] NGINX pass to backend port 3000 by default (#1) Signed-off-by: Yuchan Lee --- README.md | 2 ++ nginx/nginx.conf | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 2b28287..8161280 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ This image built based on [theasp/novnc](https://github.com/theasp/docker-novnc/ http://localhost:3000/path/to/mock + By default, if port not specified in path it will be redirected to port 3000. Request to `http://localhost/path/to/mock` is equal to `http://localhost/3000/path/to/mock`. + > Only port range in 3000-3999 will be forwarded by configuration, otherwise NGINX will respond with **404 Not Found**. ## 📔 Usage diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 96c90e6..20d15f2 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -11,5 +11,9 @@ http { rewrite "^/\d{4}(?:/(.*))?" /$1 break; proxy_pass http://127.0.0.1:$port; } + + location ~ / { + proxy_pass http://127.0.0.1:3000; + } } }