-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.conf
157 lines (126 loc) · 4.78 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
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
proxy_cache_path /data/nginx/cache/alcor levels=1:2 keys_zone=alcor:1m max_size=1g inactive=60m use_temp_path=off;
limit_conn_zone $http_cf_connecting_ip zone=addr:10m;
limit_req_zone $http_cf_connecting_ip zone=ip:10m rate=3r/s;
map $sent_http_content_type $expires {
"text/html" epoch;
"text/html; charset=utf-8" epoch;
default off;
}
server {
listen 80;
listen [::]:80;
server_name .alcor.exchange;
limit_conn addr 100;
gzip on;
gzip_types text/plain application/xml text/css application/javascript;
gzip_min_length 1000;
location /google22bede0c7dacf7c9.html {
alias /var/www/eosswap.io/google22bede0c7dacf7c9.html;
}
location /api {
# DDOS
# limit_req zone=ip;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 1m;
proxy_connect_timeout 1m;
proxy_pass http://localhost:7004/api;
# kill cache
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires off;
etag off;
# CORS
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
}
location ~* \.io {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy false;
proxy_pass http://localhost:7004;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
proxy_cache_bypass $http_upgrade;
proxy_cache_key "$host$request_uri";
proxy_cache alcor;
proxy_cache_revalidate on;
proxy_cache_valid 200 2m;
proxy_cache_min_uses 3;
proxy_cache_use_stale error timeout updating http_500 http_502
http_503 http_504;
proxy_cache_background_update on;
proxy_cache_lock on;
expires $expires;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
#proxy_read_timeout 1m;
proxy_connect_timeout 1m;
proxy_pass http://localhost:7003;
# wss try
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
}
}
server {
listen 80;
listen [::]:80;
server_name dev.alcor.exchange;
gzip on;
gzip_types text/plain application/xml text/css application/javascript;
gzip_min_length 1000;
location /google22bede0c7dacf7c9.html {
alias /var/www/eosswap.io/google22bede0c7dacf7c9.html;
}
location ~* \.io {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy false;
proxy_pass http://localhost:7008;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
proxy_cache_bypass $http_upgrade;
proxy_cache_key "$host$request_uri";
proxy_cache alcor;
proxy_cache_revalidate on;
proxy_cache_valid 200 2m;
proxy_cache_min_uses 3;
proxy_cache_use_stale error timeout updating http_500 http_502
http_503 http_504;
proxy_cache_background_update on;
proxy_cache_lock on;
expires $expires;
proxy_redirect off;
proxy_set_header Host 'alcor.exchange';
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
#proxy_read_timeout 1m;
proxy_connect_timeout 1m;
proxy_pass http://localhost:7008;
# wss try
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
}
}