server { listen 80; listen [::]:80; server_name nginx.local.cetacean.club; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; location /.within.website/ { proxy_pass http://localhost:8923; auth_request off; } location @redirectToAnubis { return 307 /.within.website/?redir=$scheme://$host$request_uri; auth_request off; } location / { auth_request /.within.website/x/cmd/anubis/api/check; error_page 401 = @redirectToAnubis; root /usr/share/nginx/html; index index.html index.htm; } }