Skip to content

Commit

Permalink
Adding proxy_pass to nginx for ChatQnA UI
Browse files Browse the repository at this point in the history
Signed-off-by: SeanCondon <[email protected]>
  • Loading branch information
SeanCondon committed Aug 16, 2024
1 parent 71363a6 commit efa2ffb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
5 changes: 2 additions & 3 deletions ChatQnA/docker/ui/docker/Dockerfile.react
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ RUN ["npm", "run", "build"]
FROM nginx:alpine

COPY --from=vite-app /usr/app/react/dist /usr/share/nginx/html
COPY ./react/env.sh /docker-entrypoint.d/env.sh

COPY ./react/nginx.conf /etc/nginx/conf.d/default.conf
RUN chmod +x /docker-entrypoint.d/env.sh
COPY ./react/nginx.conf /tmp/nginx.conf
ENTRYPOINT envsubst < /tmp/nginx.conf > /etc/nginx/conf.d/default.conf && /usr/sbin/nginx -g "daemon off;"
4 changes: 2 additions & 2 deletions ChatQnA/docker/ui/react/.env.production
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VITE_BACKEND_SERVICE_ENDPOINT=APP_BACKEND_SERVICE_ENDPOINT
VITE_DATA_PREP_SERVICE_URL=APP_DATA_PREP_SERVICE_URL
VITE_BACKEND_SERVICE_ENDPOINT=/v1/chatqna
VITE_DATA_PREP_SERVICE_URL=/v1/dataprep
15 changes: 0 additions & 15 deletions ChatQnA/docker/ui/react/env.sh

This file was deleted.

8 changes: 8 additions & 0 deletions ChatQnA/docker/ui/react/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,13 @@ server {
location ~* \.(gif|jpe?g|png|webp|ico|svg|css|js|mp4|woff2)$ {
expires 1d;
}

location "/v1/chatqna" {
proxy_pass $CHAT_BASE_URL;
}

location "/v1/dataprep" {
proxy_pass $UPLOAD_FILE_BASE_URL;
}
}
}

0 comments on commit efa2ffb

Please sign in to comment.