ran-boilerplate
Version:
React . Apollo (GraphQL) . Next.js Toolkit
64 lines (51 loc) • 1.74 kB
Plain Text
#################################################################################
### Put this file in /etc/nginx/conf.d folder if you want to support HTTP only
### and make sure you have a line 'include /etc/nginx/conf.d/*.conf;'
### in your main nginx configuration file
#################################################################################
#################################################################################
### HTTP configurations
#################################################################################
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
### Change "exampleaddress.com" to your host name
server_name localhost exampleaddress.com;
### Change "YOUR_DIRECTORY" to your directory
root /var/www/YOUR_DIRECTORY;
index index.html index.htm;
location / {
### default port, could be changed if you use next with custom server
proxy_pass http://localhost:3000;
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;
### if you have try_files like this, remove it from our block
### otherwise next app will not work properly
### try_files $uri $uri/ =404;
}
location /sw.js {
add_header Cache-Control "no-cache";
proxy_cache_bypass $http_pragma;
proxy_cache_revalidate on;
expires off;
access_log off;
}
location /favicon.ico {
log_not_found off;
access_log off;
}
location /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ /\. {
deny all;
}
location ~* /(?:uploads|files)/.*\.js$ {
deny all;
}
}