-
Notifications
You must be signed in to change notification settings - Fork 20
/
nginx.conf
68 lines (53 loc) · 1.9 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
error_log logs/error.log debug;
events { }
http {
proxy_cache_path cache/ keys_zone=auth_cache:10m;
upstream backend {
server 127.0.0.1:8080;
}
upstream elk {
server 49.52.11.228:5601;
}
server {
listen 80;
location / {
auth_request /auth-proxy;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
error_page 401 =200 /login;
proxy_pass http://backend/;
}
location /login {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Target $request_uri;
proxy_pass http://backend/login;
}
location /logout {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://backend/logout;
}
location /captcha {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://backend/captcha;
}
location /static {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://backend/static;
}
location = /auth-proxy {
internal;
proxy_pass http://backend/auth-proxy;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_cache auth_cache;
proxy_cache_valid 200 10m;
proxy_cache_key "$http_authorization$cookie_sessionID";
proxy_set_header X-CookieName "sessionID";
proxy_set_header Cookie sessionID=$cookie_sessionID;
}
}
}