forked from pi0neerpat/indexer-docker-compose
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindexer.conf
More file actions
86 lines (73 loc) · 2.28 KB
/
indexer.conf
File metadata and controls
86 lines (73 loc) · 2.28 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
server {
# CHANGE ME
server_name indexer.mysite.com;
location ^~ /index-node/ {
# Remove the /index-node/ again
rewrite ^/index-node/(.*)$ /$1 break;
# Proxy configuration.
proxy_pass http://127.0.0.1:8030;
proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_cache_bypass $http_upgrade;
# Gateway timeout.
proxy_read_timeout 30s;
proxy_send_timeout 30s;
}
location /nginx_status {
stub_status;
}
location / {
location = / {
return 200;
}
# Move WebSocket and HTTP requests into /ws/ and /http/ prefixes;
# this allows us to forward both types of requests to different
# query node ports
if ( $connection_upgrade = "upgrade" ) {
rewrite ^(.*)$ /ws/$1;
}
if ( $connection_upgrade != "upgrade" ) {
rewrite ^(.*)$ /http/$1;
}
location /http/ {
# Remove the /http/ again
rewrite ^/http/(.*)$ $1 break;
# Proxy configuration.
proxy_pass http://127.0.0.1:8000;
proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
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_cache_bypass $http_upgrade;
proxy_next_upstream error invalid_header http_502;
# Gateway timeout.
proxy_read_timeout 30s;
proxy_send_timeout 30s;
}
location /ws {
# Remove the /ws/ again
rewrite ^/ws/(.*)$ $1 break;
# Proxy configuration.
proxy_pass http://127.0.0.1:8001;
proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
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_cache_bypass $http_upgrade;
# Gateway timeout.
proxy_read_timeout 1800s;
proxy_send_timeout 1800s;
}
}
error_page 404 404.html;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
}