-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
290 lines (247 loc) · 9.46 KB
/
nginx.conf
File metadata and controls
290 lines (247 loc) · 9.46 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
proxy_cache_path /tmp/nginx_cache levels=1:2 keys_zone=ncache:10m max_size=1g inactive=60m;
server {
listen 80 default_server;
server_name envict.com;
return 301 https://$server_name$request_uri;
}
map $ssl_client_raw_cert $a {
"~^(-.*-\n)(?<fst>[^\n]+)\n((?<b>[^\n]+)\n)?((?<c>[^\n]+)\n)?((?<d>[^\n]+)\n)?((?<e>[^\n]+)\n)?((?<f>[^\n]+)\n)?((?<g>[^\n]+)\n)?((?<h>[^\n]+)\n)?((?<i>[^\n]+)\n)?((?<j>[^\n]+)\n)?((?<k>[^\n]+)\n)?((?<l>[^\n]+)\n)?((?<m>[^\n]+)\n)?((?<n>[^\n]+)\n)?((?<o>[^\n]+)\n)?((?<p>[^\n]+)\n)?((?<q>[^\n]+)\n)?((?<r>[^\n]+)\n)?((?<s>[^\n]+)\n)?((?<t>[^\n]+)\n)?((?<v>[^\n]+)\n)?((?<u>[^\n]+)\n)?((?<w>[^\n]+)\n)?((?<x>[^\n]+)\n)?((?<y>[^\n]+)\n)?((?<z>[^\n]+)\n)?((?<ab>[^\n]+)\n)?((?<ac>[^\n]+)\n)?((?<ad>[^\n]+)\n)?((?<ae>[^\n]+)\n)?((?<af>[^\n]+)\n)?((?<ag>[^\n]+)\n)?((?<ah>[^\n]+)\n)?((?<ai>[^\n]+)\n)?((?<aj>[^\n]+)\n)?((?<ak>[^\n]+)\n)?((?<al>[^\n]+)\n)?((?<am>[^\n]+)\n)?((?<an>[^\n]+)\n)?((?<ao>[^\n]+)\n)?((?<ap>[^\n]+)\n)?((?<aq>[^\n]+)\n)?((?<ar>[^\n]+)\n)?((?<as>[^\n]+)\n)?((?<at>[^\n]+)\n)?((?<av>[^\n]+)\n)?((?<au>[^\n]+)\n)?((?<aw>[^\n]+)\n)?((?<ax>[^\n]+)\n)?((?<ay>[^\n]+)\n)?((?<az>[^\n]+)\n)*(-.*-)$"
$fst;
}
server {
listen 443 ssl default_server;
server_name whigi2-demo.envict.com;
ssl on;
ssl_certificate /root/website-cert.pem;
ssl_certificate_key /root/website-key.pem;
ssl_verify_client optional_no_ca;
gzip on;
gzip_min_length 1000;
gzip_proxied any;
gzip_comp_level 7;
gzip_types *;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';
add_header Content-Security-Policy "default-src 'self' www.gstatic.com www.google.com www.paypalobjects.com www.paypal.com; script-src 'self' 'unsafe-inline' 'unsafe-eval' www.gstatic.com www.google.com www.paypalobjects.com www.paypal.com; style-src 'self' 'unsafe-inline' www.gstatic.com www.google.com www.paypalobjects.com www.paypal.com; img-src 'self' data: www.gstatic.com www.google.com www.paypalobjects.com www.paypal.com; child-src 'self' www.gstatic.com www.google.com www.paypalobjects.com www.paypal.com; form-action 'self' www.gstatic.com www.google.com www.paypalobjects.com www.paypal.com; frame-ancestors 'none';";
expires -1;
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Headers 'Content-Type, Access-Control-Allow-Headers, Authorization, x-whigi-authorization, X-Requested-With';
access_log /var/log/nginx/whigi.log;
error_log /var/log/nginx/whigi.err;
#rewrite ^/api/v\d+/schemas/(.*)/(\d+)/(\d+)/?$ /schemas/$1_$2_$3.json last;
rewrite ^/api/v\d+/selects/(.*)/?$ /selects/$1.json last;
rewrite ^/api/v\d+/helps/(.*)/?$ /helps/$1.json last;
#Helpers
location ~* /api/v\d+/generics.json {
sendfile on;
proxy_cache ncache;
expires max;
alias /root/Whigi/whigi/generics.json;
}
location ~* /api/v\d+/generics_paths.json {
sendfile on;
proxy_cache ncache;
expires max;
alias /root/Whigi/whigi/generics_paths.json;
}
#API endpoints
location /api/ {
proxy_pass http://localhost:8080;
proxy_set_header X-SSL-CERT $a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$t$v$u$w$x$y$z$ab$ac$ad$ae$af$ag$ah$ai$aj$ak$al$am$an$ao$ap$aq$ar$as$at$av$au$aw$ax$ay$az;
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;
}
#Helpers
#location /schemas/ {
# sendfile on;
# proxy_cache ncache;
# expires max;
# root /root/Whigi/whigi;
#}
location /selects/ {
sendfile on;
proxy_cache ncache;
expires max;
root /root/Whigi/whigi;
}
location /helps/ {
sendfile on;
proxy_cache ncache;
expires max;
root /root/Whigi/whigi;
}
#Mailing
location /images/ {
sendfile on;
proxy_cache ncache;
expires max;
root /root;
}
#API description
location /doc/ {
sendfile on;
proxy_cache ncache;
expires max;
root /root/Whigi;
}
#Client
location / {
try_files $uri /index.html;
sendfile on;
proxy_cache ncache;
expires max;
root /root/Whigi-Client/dist;
}
}
server {
listen 443 ssl;
server_name whigi2-restore.envict.com;
ssl on;
ssl_certificate /root/website-cert.pem;
ssl_certificate_key /root/website-key.pem;
gzip on;
gzip_min_length 1000;
gzip_proxied any;
gzip_comp_level 7;
gzip_types *;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';
expires -1;
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Headers 'Content-Type, Access-Control-Allow-Headers, Authorization, x-whigi-authorization, X-Requested-With';
access_log /var/log/nginx/whigi.log;
error_log /var/log/nginx/whigi.err;
#API endpoints
location /api/ {
proxy_pass http://localhost:8081;
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;
}
}
server {
listen 443 ssl;
server_name whigi2-advert-world.envict.com;
ssl on;
ssl_certificate /root/website-cert.pem;
ssl_certificate_key /root/website-key.pem;
gzip on;
gzip_min_length 1000;
gzip_proxied any;
gzip_comp_level 7;
gzip_types *;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';
expires -1;
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Headers 'Content-Type, Access-Control-Allow-Headers, Authorization, x-whigi-authorization, X-Requested-With';
access_log /var/log/nginx/whigi.log;
error_log /var/log/nginx/whigi.err;
#API endpoints
location /api/ {
proxy_pass http://localhost:8090;
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;
}
}
server {
listen 443 ssl;
server_name whigi2-advert-bel.envict.com;
ssl on;
ssl_certificate /root/website-cert.pem;
ssl_certificate_key /root/website-key.pem;
gzip on;
gzip_min_length 1000;
gzip_proxied any;
gzip_comp_level 7;
gzip_types *;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';
expires -1;
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Headers 'Content-Type, Access-Control-Allow-Headers, Authorization, x-whigi-authorization, X-Requested-With';
access_log /var/log/nginx/whigi.log;
error_log /var/log/nginx/whigi.err;
#API endpoints
location /api/ {
proxy_pass http://localhost:8091;
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;
}
}
server {
listen 443;
server_name whigi2-manage.envict.com;
ssl on;
ssl_certificate /root/website-cert.pem;
ssl_certificate_key /root/website-key.pem;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;
access_log /var/log/nginx/whigi.log;
error_log /var/log/nginx/whigi.err;
location / {
proxy_pass https://localhost:8000;
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;
}
}
server {
listen 9000;
server_name localhost;
access_log /var/log/nginx/whigi.log;
error_log /var/log/nginx/whigi.err;
index index.html index.htm index.php;
root /var/www;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
server {
listen 443 ssl;
server_name whigi2-showroom.envict.com;
ssl on;
ssl_certificate /root/website-cert.pem;
ssl_certificate_key /root/website-key.pem;
gzip on;
gzip_min_length 1000;
gzip_proxied any;
gzip_comp_level 7;
gzip_types *;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';
expires -1;
access_log /var/log/nginx/whigi.log;
error_log /var/log/nginx/whigi.err;
location / {
try_files $uri /index.html;
sendfile on;
proxy_cache ncache;
expires max;
root /home/gregoire/Whigi-Showroom;
}
}