forked from liquidity-network/nocust-hub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
121 lines (94 loc) · 3.49 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
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 10;
proxy_read_timeout 5s;
# Enable gzip but do not remove ETag headers
gzip on;
gzip_vary on;
gzip_comp_level 4;
gzip_min_length 256;
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
# set max upload size
client_max_body_size 1M;
server {
return 404;
}
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
default $http_x_forwarded_proto;
'' $scheme;
}
map $http_x_forwarded_port $proxy_x_forwarded_port {
default $http_x_forwarded_port;
'' $server_port;
}
map $http_upgrade $proxy_connection {
default upgrade;
'' close;
}
server {
listen 80;
server_name NGINX_HOSTS;
location /static {
root /var/www/operator_api;
}
location /whitelist {
alias /var/www/operator_api/static/registration/;
index index.html;
try_files $uri $uri/ index.html =404;
}
location ~* "^/audit/([0-9]+/(?:0x)?[a-fA-F0-9]{40}/(?:0x)?[a-fA-F0-9]{40})/$" {
add_header 'Access-Control-Allow-Origin' '*';
root /var/www/operator_api/cache;
try_files /$1.json @app;
}
location / {
try_files $uri @app;
}
location @app {
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
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 $proxy_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
proxy_set_header Proxy "";
proxy_redirect off;
proxy_buffering off;
proxy_read_timeout 90m;
proxy_pass http://operator_api:3031;
}
location /ethrpc {
proxy_pass http://eth:8545;
}
# location /ethmon {
# proxy_pass http://eth_dashboard:3000/;
# }
# location /css {
# proxy_pass http://eth_dashboard:3000/css/;
# }
# location /js {
# proxy_pass http://eth_dashboard:3000/js/;
# }
# location /primus/ {
# proxy_pass http://eth_dashboard:3000/primus/;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# }
}
}