This repository has been archived by the owner on Feb 14, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
nginx.conf
121 lines (110 loc) · 3.29 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Nginx Cumulonimbus Configuration
# DO NOT copy this file to sites-enabled in /etc/nginx symlink it so you don't have to copy it after every update.
log_format default '$http_x_forwarded_for - [$time_local] '
'$host "$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
client_max_body_size 100G;
access_log /var/log/nginx/access.log default;
error_log /var/log/nginx/error.log;
upstream backend {
least_conn;
server localhost:8000;
server localhost:8001;
}
upstream preview {
least_conn;
server localhost:8100;
server localhost:8101;
server localhost:8102;
server localhost:8103;
server localhost:8104;
server localhost:8105;
}
server {
listen 443 ssl default_server http2;
server_name _;
# /var/www-data should be symlinked to the root directory of this project.
root /var/www-data;
ssl_certificate /var/www-data/certs/public.pem;
ssl_certificate_key /var/www-data/certs/private.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
expires 30d;
add_header Cache-Control "public, no-transform";
add_header Access-Control-Allow-Origin * always;
ssl_ciphers HIGH:!aNULL:!MD5;
location ~ ^/api/domain/verify/ {
expires -1;
proxy_pass http://backend;
proxy_redirect \ http://backend/ /;
proxy_read_timeout 60s;
}
try_files /uploads/$uri @redirect;
location = / {
try_files /domain-specific-pages/$host.html @redirect;
}
location @redirect {
return 308 https://alekeagle.me$request_uri;
}
}
server {
listen 443 ssl http2;
server_name alekeagle.me localhost 192.168.*;
root /var/www-data/dist/;
expires 30d;
add_header Cache-Control "public, no-transform";
add_header Access-Control-Allow-Origin * always;
index /index.html;
try_files /../uploads/$uri $uri $uri/ /index.html;
location ~ ^/api/(.*) {
expires -1;
proxy_pass http://backend;
proxy_redirect \ http://backend/ /;
proxy_read_timeout 60s;
proxy_set_header Host $host;
}
}
server {
listen 80 default_server;
return 308 https://$host$request_uri;
}
server {
listen 80;
server_name http.localhost;
root /var/www-data/dist/;
expires 30d;
add_header Cache-Control "public, no-transform";
add_header Access-Control-Allow-Origin * always;
index /index.html;
try_files /../uploads/$uri $uri $uri/ /index.html;
location ~ ^/api/(.*) {
expires -1;
proxy_pass http://backend;
proxy_redirect \ http://backend/ /;
proxy_read_timeout 60s;
proxy_set_header Host $host;
}
}
server {
listen 443 ssl http2;
server_name previews.alekeagle.me previews.localhost;
expires 30d;
add_header Cache-Control "public, no-transform";
add_header Access-Control-Allow-Origin * always;
location ~ ^/(.*) {
proxy_pass http://preview;
proxy_redirect \ http://preview/ /;
proxy_read_timeout 60s;
proxy_set_header Host $host;
}
}
server {
listen 443 ssl http2;
server_name docs.alekeagle.me docs.localhost;
# if you plan on running the documentation along side the API, make sure /var/www-data-docs/ is symlinked to sharex-vue-docs-root/src/.vuepress/dist
root /var/www-data-docs/;
expires 30d;
add_header Cache-Control "public, no-transform";
add_header Access-Control-Allow-Origin * always;
index /index.html;
try_files $uri $uri/ /index.html;
}