-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtpu.conf
35 lines (30 loc) · 1.17 KB
/
tpu.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
# Add proxy_cache_path /etc/nginx/auth_cache levels=1:2 keys_zone=auth_cache:1m max_size=1g inactive=60m; to http directive of nginx.conf
js_import tpu.js;
set $token $cookie_token;
# Please set $tpu_app_id variable per virtualhost basis, it is required!
location /tpu_callback {
if ($args ~* "code=(?<token>[^&]+)") {
add_header Set-Cookie "token=$token";
}
set $redirect_path $arg_redirect_path;
if ($redirect_path = "") {
set $redirect_path "/";
}
return 302 $redirect_path;
}
location /_tpu_get_user {
internal;
proxy_method GET;
proxy_set_header accept "application/json";
proxy_set_header accept "Authorization";
proxy_set_header accept "X-TPU-App-Id";
proxy_set_header Authorization $token;
proxy_set_header Content-Type "application/json";
proxy_set_header X-TPU-App-Id $tpu_app_id;
proxy_cache auth_cache;
proxy_cache_key "$tpu_app_id$token";
proxy_ignore_headers Expires Cache-Control;
proxy_cache_valid 200 204 10m;
proxy_ssl_server_name on;
proxy_pass https://flowinity.com/api/v3/oauth/user;
}