From 752c1a1b407430ef03b6691e320c0aee81f8d833 Mon Sep 17 00:00:00 2001
From: L4168 <L4168@student.jamk.fi>
Date: Wed, 17 Jul 2019 14:20:11 +0300
Subject: [PATCH] add nginx config for react-router

---
 Dockerfile   |  1 +
 default.conf | 10 ++++++++++
 2 files changed, 11 insertions(+)
 create mode 100644 default.conf

diff --git a/Dockerfile b/Dockerfile
index 3ef2135..88b5046 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -10,5 +10,6 @@ RUN npm run build
 # production environment
 FROM nginx:1.16.0-alpine
 COPY --from=build /usr/src/app/build /usr/share/nginx/html
+COPY default.conf /etc/nginx/conf.d/default.conf
 EXPOSE 80
 CMD ["nginx", "-g", "daemon off;"]
diff --git a/default.conf b/default.conf
new file mode 100644
index 0000000..6f9b932
--- /dev/null
+++ b/default.conf
@@ -0,0 +1,10 @@
+server {
+    listen       80;
+    server_name  localhost;
+    location / {
+        try_files $uri /index.html;
+        root   /usr/share/nginx/html;
+        index  index.html index.htm;
+    }
+    error_page   500 502 503 504  /50x.html;
+}
\ No newline at end of file
-- 
GitLab