Skip to content

Commit

Permalink
Updated NGINX config
Browse files Browse the repository at this point in the history
steveholgado committed Nov 26, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 1f33ee1 commit 300c759
Showing 3 changed files with 13 additions and 15 deletions.
1 change: 0 additions & 1 deletion nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -6,4 +6,3 @@ RUN rm /etc/nginx/conf.d/*
# Copy config files
# *.conf files in "conf.d/" dir get included in main config
COPY ./default.conf /etc/nginx/conf.d/
COPY ./proxy_nextjs /etc/nginx/conf.d/
19 changes: 13 additions & 6 deletions nginx/default.conf
Original file line number Diff line number Diff line change
@@ -14,6 +14,13 @@ server {
gzip_comp_level 4; # Compression level
gzip_types text/css application/javascript image/svg+xml;

# https://github.com/zeit/next.js/wiki/Deployment-on-Nginx's-reverse-proxy
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;

# Next.js built assets (e.g. JS page bundles)
location /_next/static {

@@ -27,8 +34,8 @@ server {
# Uncomment below line to test server caching - HIT, MISS, etc.
# add_header X-Cache-Status $upstream_cache_status;

# Pass to Next.js app
include /etc/nginx/conf.d/proxy_nextjs;
# Pass to Next.js app - "nextjs" defined in docker-compose.yml
proxy_pass http://nextjs:3000;
}

# Next.js static assets (e.g. images)
@@ -45,13 +52,13 @@ server {
# Uncomment below line to test server caching - HIT, MISS, etc.
# add_header X-Cache-Status $upstream_cache_status;

# Pass to Next.js app
include /etc/nginx/conf.d/proxy_nextjs;
# Pass to Next.js app - "nextjs" defined in docker-compose.yml
proxy_pass http://nextjs:3000;
}

# Dynamically generated files - no cache
location / {
# Pass to Next.js app
include /etc/nginx/conf.d/proxy_nextjs;
# Pass to Next.js app - "nextjs" defined in docker-compose.yml
proxy_pass http://nextjs:3000;
}
}
8 changes: 0 additions & 8 deletions nginx/proxy_nextjs

This file was deleted.

0 comments on commit 300c759

Please sign in to comment.