Skip to content

Instantly share code, notes, and snippets.

@YellowOnion
Created May 14, 2026 01:49
Show Gist options
  • Select an option

  • Save YellowOnion/bbb11ef8f5baf2fd9548cd94a9f566e2 to your computer and use it in GitHub Desktop.

Select an option

Save YellowOnion/bbb11ef8f5baf2fd9548cd94a9f566e2 to your computer and use it in GitHub Desktop.
error_log logs/error.log;
pid nginx.pid;
daemon off;
events {}
http {
access_log logs/access.log;
server {
listen 0.0.0.0:9998;
listen [::0]:9998;
location /login {
proxy_pass http://localhost:8081/login;
}
location / {
auth_request /auth;
root ./;
autoindex on;
error_page 401 = @error401;
}
location @error401 {
return 302 /login?returnTo=$scheme://$host$is_request_port$request_port$request_uri;
}
location /auth {
internal;
proxy_pass http://localhost:8081/auth;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment