From f934339288a4fe618d5e509ec9ace6b309fe0ea5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= <tiangolo@gmail.com>
Date: Thu, 11 Apr 2019 21:31:34 +0400
Subject: [PATCH 1/2] :bug: Fix frontend hijacking /docs in development

---
 {{cookiecutter.project_slug}}/frontend/Dockerfile        | 1 +
 .../frontend/nginx-backend-not-found.conf                | 9 +++++++++
 2 files changed, 10 insertions(+)
 create mode 100644 {{cookiecutter.project_slug}}/frontend/nginx-backend-not-found.conf

diff --git a/{{cookiecutter.project_slug}}/frontend/Dockerfile b/{{cookiecutter.project_slug}}/frontend/Dockerfile
index fb25c36faf1..deb8aae451a 100644
--- a/{{cookiecutter.project_slug}}/frontend/Dockerfile
+++ b/{{cookiecutter.project_slug}}/frontend/Dockerfile
@@ -25,3 +25,4 @@ FROM nginx:1.15
 COPY --from=build-stage /app/dist/ /usr/share/nginx/html
 
 COPY --from=build-stage /nginx.conf /etc/nginx/conf.d/default.conf
+COPY ./nginx-backend.conf /etc/nginx/extra-conf.d/backend-not-found.conf
diff --git a/{{cookiecutter.project_slug}}/frontend/nginx-backend-not-found.conf b/{{cookiecutter.project_slug}}/frontend/nginx-backend-not-found.conf
new file mode 100644
index 00000000000..f6fea663580
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/frontend/nginx-backend-not-found.conf
@@ -0,0 +1,9 @@
+location /api {
+    return 404;
+}
+location /docs {
+    return 404;
+}
+location /redoc {
+    return 404;
+}

From ff901a3ad8b4181de1ce9271cb6abf9ddd1d84c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= <tiangolo@gmail.com>
Date: Thu, 11 Apr 2019 21:39:00 +0400
Subject: [PATCH 2/2] :bug: Fix frontend Dockerfile copying Nginx config

---
 {{cookiecutter.project_slug}}/frontend/Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/{{cookiecutter.project_slug}}/frontend/Dockerfile b/{{cookiecutter.project_slug}}/frontend/Dockerfile
index deb8aae451a..75157e0968e 100644
--- a/{{cookiecutter.project_slug}}/frontend/Dockerfile
+++ b/{{cookiecutter.project_slug}}/frontend/Dockerfile
@@ -25,4 +25,4 @@ FROM nginx:1.15
 COPY --from=build-stage /app/dist/ /usr/share/nginx/html
 
 COPY --from=build-stage /nginx.conf /etc/nginx/conf.d/default.conf
-COPY ./nginx-backend.conf /etc/nginx/extra-conf.d/backend-not-found.conf
+COPY ./nginx-backend-not-found.conf /etc/nginx/extra-conf.d/backend-not-found.conf