-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
52 lines (42 loc) · 1.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
server {
listen 80;
server_name this-project.busykoala.io
client_max_body_size 50M;
gzip on;
gzip_vary on;
gzip_types application/json application/javascript text/css;
proxy_buffering off;
proxy_buffer_size 32k;
proxy_busy_buffers_size 48k;
proxy_buffers 128 8k;
location /oauth2/ {
proxy_pass http://authproxy:4180;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Auth-Request-Redirect $request_uri;
}
location = /oauth2/auth {
proxy_pass http://authproxy:4180;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
# nginx auth_request includes headers but not body
proxy_set_header Content-Length "";
proxy_pass_request_body off;
}
location / {
auth_request /oauth2/auth;
error_page 401 = /oauth2/sign_in;
proxy_pass http://web-server:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
auth_request_set $user $upstream_http_x_auth_request_user;
auth_request_set $email $upstream_http_x_auth_request_email;
auth_request_set $auth_stuff $upstream_http_x_auth_request_access_token;
proxy_set_header X-User $user;
proxy_set_header X-Email $email;
proxy_set_header X-AccessToken $auth_stuff;
}
}