add nginx as reverse proxy

This commit is contained in:
ChihYu Yeh
2024-07-27 01:52:54 +08:00
parent e64e0ea330
commit b831c1c15a
2 changed files with 31 additions and 3 deletions
+13 -3
View File
@@ -106,9 +106,8 @@ services:
EXPERIMENTAL_ENGINE_RUST_VERSION: ${EXPERIMENTAL_ENGINE_RUST_VERSION}
# configs
WREN_PRODUCT_VERSION: ${WREN_PRODUCT_VERSION}
ports:
# HOST_PORT is the port you want to expose to the host machine
- ${HOST_PORT}:3000
expose:
- 3000
volumes:
- data:/app/data
networks:
@@ -116,3 +115,14 @@ services:
depends_on:
- wren-ai-service
- wren-engine
nginx:
image: nginx
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- 4000:80
networks:
- wren
depends_on:
- wren-ui
+18
View File
@@ -0,0 +1,18 @@
upstream wren_ui_app {
server wren-ui:3000;
}
server {
location / {
# reverse proxy for next server
proxy_pass http://wren_ui_app; #Don't forget to update your port number
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
listen 80 default_server;
listen [::]:80;
}