-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,36 @@ | ||
upstream naarad { | ||
server naarad:8000; | ||
server naarad:8000; | ||
} | ||
|
||
server { | ||
server_name naarad.metakgp.org; | ||
server_name naarad.metakgp.org; | ||
|
||
location / { | ||
proxy_pass http://naarad; | ||
location /web { | ||
auth_request /auth; | ||
error_page 400 401 500 =200 @handle_auth; | ||
|
||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
} | ||
} | ||
proxy_pass http://naarad; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
} | ||
|
||
location /auth { | ||
internal; | ||
proxy_pass https://heimdall-api.metakgp.org/validate-jwt; | ||
proxy_set_header Cookie $http_cookie; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
|
||
location @handle_auth { | ||
return 301 https://heimdall.metakgp.org/?redirect_url=https://$server_name$request_uri; | ||
} | ||
|
||
location / { | ||
proxy_pass http://naarad; | ||
|
||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
} | ||
} |