Skip to content

Commit 63d5112

Browse files
Tuomas Kaittolatuokait
Tuomas Kaittola
authored andcommitted
Redirect all requests to index.html with nginx
- This is required in order to get routing to work.
1 parent 6e39cb6 commit 63d5112

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ RUN yarn build
1111

1212
FROM nginx:1.19.6-alpine
1313
EXPOSE 80
14+
COPY default.conf /etc/nginx/conf.d/default.conf
1415
COPY --from=build /app/out /usr/share/nginx/html
1516
CMD ["nginx", "-g", "daemon off;"]

default.conf

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
server {
2+
listen 80 default_server;
3+
listen [::]:80 default_server;
4+
server_name localhost;
5+
6+
location / {
7+
root /usr/share/nginx/html;
8+
index index.html index.htm;
9+
try_files $uri $uri/ /index.html;
10+
}
11+
}

0 commit comments

Comments
 (0)