feat: add control panel
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name _;
|
||||
|
||||
ssl_certificate /etc/nginx/tls/tls.crt;
|
||||
ssl_certificate_key /etc/nginx/tls/tls.key;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
error_page 401 = /oauth2/sign_in?rd=https://$http_host$request_uri;
|
||||
|
||||
location = /oauth2/auth {
|
||||
internal;
|
||||
proxy_pass http://oauth2-proxy:4180/oauth2/auth;
|
||||
proxy_pass_request_body off;
|
||||
proxy_set_header Content-Length "";
|
||||
proxy_set_header X-Original-URI $request_uri;
|
||||
proxy_set_header X-Auth-Request-Redirect https://$http_host$request_uri;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header X-Forwarded-Host $http_host;
|
||||
}
|
||||
|
||||
location /oauth2/ {
|
||||
proxy_pass http://oauth2-proxy:4180;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header X-Forwarded-Host $http_host;
|
||||
}
|
||||
|
||||
location /api/v1/ {
|
||||
auth_request /oauth2/auth;
|
||||
auth_request_set $auth_user $upstream_http_x_auth_request_user;
|
||||
auth_request_set $auth_groups $upstream_http_x_auth_request_groups;
|
||||
|
||||
proxy_pass http://control-panel-api:3010/api/v1/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
|
||||
# Overwrite browser-supplied identity headers. The API maps these IdP
|
||||
# group claims through rbac-check.py map-claim.
|
||||
proxy_set_header X-CASAN-Actor $auth_user;
|
||||
proxy_set_header X-CASAN-Groups $auth_groups;
|
||||
proxy_set_header X-CASAN-Role "";
|
||||
}
|
||||
|
||||
location = /healthz {
|
||||
auth_request /oauth2/auth;
|
||||
proxy_pass http://control-panel-api:3010/healthz;
|
||||
}
|
||||
|
||||
location / {
|
||||
auth_request /oauth2/auth;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user