GitHub user happyaron opened an issue:
https://github.com/apache/trafficserver/issues/1417
PURGE request returns 404 when map rule uses authproxy
Testing environment:
OS: Debian testing amd64
ATS: 7.0.0
package version: 7.0.0-4
1. remap.config:
map http://auth.internal/ http://auth.internal/
map http://test.example.com/ http://backend.internal/ \
@plugin=authproxy.so @pparam=--auth-transform=redirect
@pparam=--auth-host=auth.internal @pparam=--auth-port=80
2. records.config snip:
CONFIG proxy.config.url_remap.remap_required INT 1
CONFIG proxy.config.url_remap.pristine_host_hdr INT 1
CONFIG proxy.config.reverse_proxy.enabled INT 1
CONFIG proxy.config.http.doc_in_cache_skip_dns INT 0
3. auth.internal always return 200 OK here:
$ curl -v4X PURGE http://auth.internal/
* Hostname was NOT found in DNS cache
* Trying a.b.c.d...
* Connected to auth.internal (a.b.c.d) port 80 (#0)
> PURGE / HTTP/1.1
> User-Agent: curl/7.38.0
> Host: auth.internal
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Fri, 03 Feb 2017 17:13:21 GMT
* Server Apache is not blacklisted
< Server: Apache
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate
< Pragma: no-cache
< Set-Cookie: SESSION_NAME=ir6l53v0474cffo7bv0o21qmn6; path=/; HttpOnly
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
<
* Connection #0 to host auth.internal left intact
4. Make some modifications to index.html, test to PURGE:
$ curl -v4X PURGE http://test.example.com/
* Hostname was NOT found in DNS cache
* Trying e.f.g.hâ¦
* Connected to test.example.com (e.f.g.h) port 80 (#0)
> PURGE / HTTP/1.1
> User-Agent: curl/7.38.0
> Host: test.example.com
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Date: Fri, 03 Feb 2017 17:24:48 GMT
< Connection: close
* Server ATS is not blacklisted
< Server: ATS
< Content-Length: 14
< Content-Type: text/plain
* Closing connection 0
404 Not Found
5. ATS log:
1486142993.517 0 192.168.1.1 TCP_MISS/404 114 PURGE http://auth.internal/ -
NONE/- -
1486142993.517 0 192.168.1.1 TCP_MISS/404 155 PURGE
http://backend.internal/ - DIRECT/- text/plain
6. Verified that the content is not actually purged (index.html content not
updated).
----
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---