wip
This commit is contained in:
parent
1e11c8ca5e
commit
13b6d1b78a
9 changed files with 108 additions and 232 deletions
20
nginx.conf
20
nginx.conf
|
|
@ -39,6 +39,18 @@ http {
|
|||
add_header Content-Type text/html;
|
||||
return 302 http://localhost:8000/login/;
|
||||
}
|
||||
location /me {
|
||||
auth_request /authz;
|
||||
error_page 401 = @login; # If not authed, redirect to login page
|
||||
error_page 403 = @forbidden; # If forbidden, show custom 403 page
|
||||
|
||||
# Disable all caching for demo purposes
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
|
||||
add_header Pragma "no-cache";
|
||||
add_header Expires "Thu, 01 Jan 1970 00:00:00 GMT";
|
||||
|
||||
proxy_pass http://localhost:5115/me;
|
||||
}
|
||||
|
||||
location @forbidden {
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
|
||||
|
|
@ -73,8 +85,12 @@ http {
|
|||
add_header Expires "Thu, 01 Jan 1970 00:00:00 GMT";
|
||||
try_files $uri $uri/index.html =404;
|
||||
}
|
||||
# AJAX login: POST to FastAPI
|
||||
location /login {
|
||||
# Handle /login - GET goes to page, POST goes to FastAPI
|
||||
location = /login {
|
||||
if ($request_method = GET) {
|
||||
return 302 /login/;
|
||||
}
|
||||
# POST requests go to FastAPI
|
||||
proxy_pass http://127.0.0.1:5115/login;
|
||||
proxy_set_header Content-Type $content_type;
|
||||
proxy_pass_request_body on;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue