Skip to content

Commit 887aaeb

Browse files
committed
Nginx config according to: fastapi/full-stack-fastapi-template#6
1 parent 2013c75 commit 887aaeb

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

frontend/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ RUN npm run build
2020

2121

2222
# Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx
23-
FROM nginx:1.15-alpine
23+
FROM nginx:1.15
2424

2525
COPY --from=build-stage /app/dist/ /usr/share/nginx/html
2626

2727
COPY --from=build-stage /nginx.conf /etc/nginx/conf.d/default.conf
28+
COPY ./nginx-backend-not-found.conf /etc/nginx/extra-conf.d/backend-not-found.conf

frontend/nginx-backend-not-found.conf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
location /api {
2+
return 404;
3+
}
4+
location /docs {
5+
return 404;
6+
}
7+
location /redoc {
8+
return 404;
9+
}

0 commit comments

Comments
 (0)