-
Notifications
You must be signed in to change notification settings - Fork 16
/
nginx.conf
89 lines (79 loc) · 3.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
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
server {
listen 80;
listen [::]:80;
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-Host $server_name;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
add_header 'WWW-Authenticate' 'Bearer' 'always';
#proxy_read_timeout 300s;
#proxy_connect_timeout 75s;
sendfile on;
gzip on;
gzip_types application/json application/geo+json text/css application/javascript text/plain;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;
# Proxy requests to the bucket "wis2box-incoming" to MinIO container running on port 9000
# NOTE do not use rewrite, it crashes the upload
location /wis2box-incoming/ {
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_set_header Host $http_host;
proxy_connect_timeout 300;
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
proxy_http_version 1.1;
proxy_set_header Connection "";
chunked_transfer_encoding off;
proxy_pass http://minio:9000;
}
location /data {
# FIXME: derive alias from environment variables
auth_request /auth;
auth_request_set $auth_status $upstream_status;
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_set_header Host $http_host;
proxy_connect_timeout 300;
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
proxy_http_version 1.1;
proxy_set_header Connection "";
chunked_transfer_encoding off;
rewrite ^/data(/.*)$ /wis2box-public$1 break;
proxy_pass http://minio:9000;
}
location /oapi {
set $x_api_http_method $request_method;
auth_request /auth;
auth_request_set $auth_status $upstream_status;
proxy_pass http://wis2box-api:80;
}
location /wis2downloader {
set $x_api_http_method $request_method;
auth_request /auth;
auth_request_set $auth_status $upstream_status;
rewrite ^/wis2downloader/(.*) /$1 break;
proxy_pass http://wis2downloader:5000;
}
location /wis2box-webapp/ {
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/.htpasswd/webapp;
proxy_pass http://wis2box-webapp:4173/wis2box-webapp/;
}
location /auth {
internal;
proxy_pass http://wis2box-auth:80/authorize;
proxy_set_header Content-Length "";
proxy_set_header X-api-http-method $x_api_http_method;
proxy_set_header X-Original-URI $request_uri;
proxy_set_header Authorization $http_authorization;
proxy_pass_header Authorization;
}
location / {
proxy_pass http://wis2box-ui:80;
}
}