### `include/pass.conf`
```nginx
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 86400;
proxy_send_timeout 86400;
proxy_buffering off;
proxy_request_buffering off;
proxy_http_version 1.1;
```
### `default` Excerpt
```nginx
....
....
....
set $svc80 "http://my.service:80";
....
....
....
location /auth {
internal;
proxy_pass https://mypublicservice.com/api/auth/;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
#proxy_set_header X-Original-URI $request_uri;
}
....
....
....
location /webdav {
auth_request /auth;
proxy_pass $svc80;
include "include/pass.conf";
}
```
The `/auth` endpoint is **a 100% proven** to return a 200 on authentication. This behaviour is not only tested many times in several ways, but the NGINX log also shows a 200 every single time this endpoint is internally addressed. Therefore, the authentication indubitably works.
However, when a client tries to access `/webdav` the client supposedly receives a 401, which should be impossible.
The whole NGINX config is also proven to work, because everything worked fine before. Then, the `auth_request` directive was added and now the authentication does not work. So, the `/webdav` endpoint and the `proxy_pass` within it, is also **proven** to work.
So, what's wrong with NGINX and how can it be fixed?