-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi_nginx.conf
45 lines (37 loc) · 1.16 KB
/
api_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
upstream uwsgi {
server unix:/api_data/app.sock;
}
server {
listen 80;
charset utf-8;
client_max_body_size 75M;
location /djangostatic {
alias /api_data/static;
}
location /api {
proxy_pass http://api:8080/api;
proxy_set_header Host $host:8000;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Auth-Request-Preferred-Username DevUser;
proxy_set_header X-Auth-Request-Email [email protected];
}
location /admin {
proxy_pass http://api:8080/admin;
proxy_set_header Host $host:8000;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Auth-Request-Preferred-Username DevUser;
proxy_set_header X-Auth-Request-Email [email protected];
}
location /nginx/status {
stub_status on;
access_log off;
auth_basic "NginxStatus";
}
# Mock oauth2-proxy userinfo endpoint for development
location /oauth2/userinfo {
return 200 '{"preferredUsername": "DevUser", "email": "[email protected]"}';
}
location / {
proxy_pass http://app:3000/;
}
}