-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
89 lines (74 loc) · 2.25 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# forwards to https://www...
server {
listen 80;
listen [::]:80;
server_name tz1and.com www.tz1and.com;
server_tokens off;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://www.tz1and.com$request_uri;
}
}
# forward https non www to www
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name tz1and.com;
ssl_certificate /etc/nginx/ssl/live/tz1and.com/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/live/tz1and.com/privkey.pem;
return 301 https://www.tz1and.com$request_uri;
}
server {
listen 443 default_server ssl http2;
listen [::]:443 ssl http2;
server_name www.tz1and.com;
ssl_certificate /etc/nginx/ssl/live/tz1and.com/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/live/tz1and.com/privkey.pem;
# enable gzip compression
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 1000;
gzip_types text/plain application/javascript text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype;
# Set up cache.
expires 1y;
add_header Cache-Control "public, no-transform";
# React specific, override cache on some files, etc.
location / {
if ( $uri = '/index.html' ) {
add_header Cache-Control no-store always;
}
if ( $uri = '/asset-manifest.json' ) {
add_header Cache-Control no-store always;
}
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
#server {
# listen 443 default_server ssl http2;
# listen [::]:443 ssl http2;
#
# server_name www.tz1and.com;
#
# ssl_certificate /etc/nginx/ssl/live/tz1and.com/fullchain.pem;
# ssl_certificate_key /etc/nginx/ssl/live/tz1and.com/privkey.pem;
#
# root /etc/nginx/maintenance;
# index index.html;
#
# location / {
# try_files $uri $uri/ /index.html;
# }
#}