Skip to content

Commit

Permalink
feat: add support for routes in URL (custom nginx config)
Browse files Browse the repository at this point in the history
  • Loading branch information
Colmea committed Dec 3, 2020
1 parent 82cf57a commit bdb50f3
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ COPY . /app
RUN yarn build

FROM nginx:alpine
COPY --from=ui-builder /app/dist /usr/share/nginx/html
COPY --from=ui-builder /app/dist /etc/nginx/html
COPY --from=ui-builder /app/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
CMD ["nginx"]
47 changes: 47 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# run nginx in foreground
daemon off;

#user nobody;
worker_processes 1;

#error_log logs/error.log;
error_log stderr notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

access_log /dev/stdout;

sendfile on;

keepalive_timeout 65;

gzip on;

server {
listen 80;
server_name localhost;

location / {
root html;
index index.html index.htm;
# redirect 404 to index
try_files $uri /index.html;
}

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}

0 comments on commit bdb50f3

Please sign in to comment.