Skip to content

Instantly share code, notes, and snippets.

@AnrDaemon
Created June 20, 2019 21:01
Show Gist options
  • Save AnrDaemon/1e957065ac45ba324b27d325c1b86fac to your computer and use it in GitHub Desktop.
Save AnrDaemon/1e957065ac45ba324b27d325c1b86fac to your computer and use it in GitHub Desktop.
location ^~ /uploads/documents/ {
alias /volume/data/documents/;
set $auth_pass "$request_uri";
auth_request /auth/documents;
auth_request_set $auth_status "$upstream_status";
}
location ^~ /auth/ {
internal;
proxy_pass "http://back:8080/auth/$auth_pass";
proxy_pass_request_body off;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header X-Original-Uri "$request_uri";
proxy_set_header Content-Length "";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment