File tree Expand file tree Collapse file tree 5 files changed +33
-1
lines changed Expand file tree Collapse file tree 5 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ ENV FRONTEND_SERVICE_PORT=5173
1313ENV BACKEND_SERVICE_NAME=chatqna
1414ENV BACKEND_SERVICE_IP=localhost
1515ENV BACKEND_SERVICE_PORT=8888
16+ ENV DATAPREP_SERVICE_IP=localhost
17+ ENV DATAPREP_SERVICE_PORT=6007
1618
1719COPY comps/nginx/start-nginx.sh /usr/local/bin/start-nginx.sh
1820RUN chmod +x /usr/local/bin/start-nginx.sh
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ export FRONTEND_SERVICE_PORT=5173
2323export BACKEND_SERVICE_NAME=chatqna
2424export BACKEND_SERVICE_IP=${your_backend_service_ip}
2525export BACKEND_SERVICE_PORT=8888
26+ export DATAPREP_SERVICE_IP=${your_dataprep_service_ip}
27+ export DATAPREP_SERVICE_PORT=6007
2628export NGINX_PORT=${your_nginx_port}
2729```
2830
@@ -53,6 +55,8 @@ docker run -d --name opea-nginx -p ${NGINX_PORT}:80 \
5355 -e BACKEND_SERVICE_NAME=${BACKEND_SERVICE_NAME} \
5456 -e BACKEND_SERVICE_IP=${BACKEND_SERVICE_IP} \
5557 -e BACKEND_SERVICE_PORT=${BACKEND_SERVICE_PORT} \
58+ -e DATAPREP_SERVICE_IP=${DATAPREP_SERVICE_IP} \
59+ -e DATAPREP_SERVICE_PORT=${DATAPREP_SERVICE_PORT} \
5660 opea/nginx:latest
5761```
5862
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ services:
1616 - BACKEND_SERVICE_NAME=${BACKEND_SERVICE_NAME}
1717 - BACKEND_SERVICE_IP=${BACKEND_SERVICE_IP}
1818 - BACKEND_SERVICE_PORT=${BACKEND_SERVICE_PORT}
19+ - DATAPREP_SERVICE_IP=${DATAPREP_SERVICE_IP}
20+ - DATAPREP_SERVICE_PORT=${DATAPREP_SERVICE_PORT}
1921 ipc : host
2022 restart : always
2123
Original file line number Diff line number Diff line change @@ -25,4 +25,28 @@ server {
2525 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2626 proxy_set_header X-Forwarded-Proto $scheme;
2727 }
28+
29+ location /v1/dataprep {
30+ proxy_pass http://${DATAPREP_SERVICE_IP}:${DATAPREP_SERVICE_PORT};
31+ proxy_set_header Host $host;
32+ proxy_set_header X-Real-IP $remote_addr;
33+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
34+ proxy_set_header X-Forwarded-Proto $scheme;
35+ }
36+
37+ location /v1/dataprep/get_file {
38+ proxy_pass http://${DATAPREP_SERVICE_IP}:${DATAPREP_SERVICE_PORT};
39+ proxy_set_header Host $host;
40+ proxy_set_header X-Real-IP $remote_addr;
41+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
42+ proxy_set_header X-Forwarded-Proto $scheme;
43+ }
44+
45+ location /v1/dataprep/delete_file {
46+ proxy_pass http://${DATAPREP_SERVICE_IP}:${DATAPREP_SERVICE_PORT};
47+ proxy_set_header Host $host;
48+ proxy_set_header X-Real-IP $remote_addr;
49+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
50+ proxy_set_header X-Forwarded-Proto $scheme;
51+ }
2852}
Original file line number Diff line number Diff line change 22# SPDX-License-Identifier: Apache-2.0
33
44#! /bin/sh
5- envsubst ' ${FRONTEND_SERVICE_IP} ${FRONTEND_SERVICE_PORT} ${BACKEND_SERVICE_NAME} ${BACKEND_SERVICE_IP} ${BACKEND_SERVICE_PORT}' < /etc/nginx/nginx.conf.template > /etc/nginx/conf.d/default.conf
5+ envsubst ' ${FRONTEND_SERVICE_IP} ${FRONTEND_SERVICE_PORT} ${BACKEND_SERVICE_NAME} ${BACKEND_SERVICE_IP} ${BACKEND_SERVICE_PORT} ${DATAPREP_SERVICE_IP} ${DATAPREP_SERVICE_PORT} ' < /etc/nginx/nginx.conf.template > /etc/nginx/conf.d/default.conf
66nginx -g ' daemon off;'
You can’t perform that action at this time.
0 commit comments