Skip to content

Commit

Permalink
feat: naarad protected by heimdall
Browse files Browse the repository at this point in the history
  • Loading branch information
proffapt committed Jun 17, 2024
1 parent f26c3ae commit b6ac9ff
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions metaploy/naarad.metaploy.conf
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";
}
}

0 comments on commit b6ac9ff

Please sign in to comment.