Skip to content

Commit

Permalink
NGINX pass to backend port 3000 by default (#1)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuchan Lee <lasuillard@gmail.com>
  • Loading branch information
lasuillard authored Apr 5, 2024
1 parent 4c32c89 commit 30792c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

0 comments on commit 30792c3

Please sign in to comment.