Skip to content

Commit

Permalink
configure nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
GSvensk committed Oct 12, 2021
1 parent 3e12352 commit 816b5be
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ RUN npm prune --production
FROM nginx:latest
#
## Copy the build output to replace the default nginx contents.
COPY --from=build /usr/local/app/dist/netflix-activity /usr/share/nginx/html
COPY /nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /usr/local/app/dist/netflix-activity /usr/share/www/html

CMD ["/bin/sh", "-c", "sed -i 's/listen .*/listen 443;/g' /etc/nginx/conf.d/default.conf && envsubst < /usr/share/nginx/html/assets/env.template.js > /usr/share/nginx/html/assets/env.js && exec nginx -g 'daemon off;'"]
CMD ["/bin/sh", "-c", "envsubst < /usr/share/www/html/assets/env.template.js > /usr/share/www/html/assets/env.js && exec nginx -g 'daemon off;'"]
29 changes: 29 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
server {
listen 80;
server_name mynetflixhistory.com www.mynetflixhistory.com;

#access_log /var/log/nginx/host.access.log main;
root /usr/share/www/html;
index index.html index.htm;


location / {
try_files $uri $uri/ /index.html;
}

#error_page 404 /404.html;

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

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

0 comments on commit 816b5be

Please sign in to comment.