-
Notifications
You must be signed in to change notification settings - Fork 14
/
nginx.conf
54 lines (46 loc) · 1.54 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
limit_req_zone $binary_remote_addr zone=one:50m rate=5r/m;
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html;
}
location /api {
rewrite ^/api/?(.*) /$1 break;
proxy_pass http://server:65501;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~ /console/([a-z0-9_]+) {
resolver 127.0.0.11 ipv6=off valid=10s;
set $upstream_endpoint http://$1:1588;
rewrite ^/console/([a-z0-9_]+)/?(.*) /$2 break;
proxy_pass $upstream_endpoint;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
gzip on;
gzip_buffers 16 8k;
gzip_comp_level 6;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
gzip_types
text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml image/svg+xml
text/javascript application/javascript application/x-javascript
text/x-json application/json application/x-web-app-manifest+json
text/css text/plain text/x-component image/x-icon
font/opentype application/x-font-ttf application/vnd.ms-fontobject;
gzip_disable "msie6";
open_file_cache max=1000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
server_tokens off;
}