Fix nginx configuration override
This commit is contained in:
@@ -10,8 +10,8 @@ RUN rm -rf ./*
|
|||||||
# NOTE: If your folder is named "dist" instead of "build", change "build/" to "dist/"
|
# NOTE: If your folder is named "dist" instead of "build", change "build/" to "dist/"
|
||||||
COPY dist/ .
|
COPY dist/ .
|
||||||
|
|
||||||
# 3. Copy your custom Nginx configuration (which you already have in your log)
|
# 3. Copy your custom Nginx configuration to override the default server block
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
|||||||
23
nginx.conf
23
nginx.conf
@@ -1,18 +1,11 @@
|
|||||||
events {}
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
http {
|
location / {
|
||||||
include /etc/nginx/mime.types;
|
root /usr/share/nginx/html;
|
||||||
default_type application/octet-stream;
|
index index.html index.htm;
|
||||||
|
# This line forces Nginx to pass routing back to React Router
|
||||||
server {
|
try_files $uri $uri/ /index.html;
|
||||||
listen 80;
|
|
||||||
server_name localhost;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html index.htm;
|
|
||||||
# This line forces Nginx to pass routing back to React Router
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user