1. The problem I’m having:
I need requests to potential PDF-Files with a “.pdf” extension be normalized to their non-extension file name when handed to the index.php router via the php_fastcgi
directive (the CMS behind does not work with file extensions but another requesting client needs it).
I tried a rewrite
, a map
and finally uri strip_suffix .pdf
. But i noticed the REQUEST_URI
variable is set to the original request.
I assume there is a solution to this, e.g. via using reverse_proxy directives in php_fastcgi or via overwriting some ENV in the latter directive, but i had no luck so far. I’m thankful for any suggestions.
2. Error messages and/or full log output:
DEBUG http.handlers.rewrite rewrote request ... "uri": "/test.pdf", ... "method": "GET", "uri": "/test"}
DEBUG http.reverse_proxy.transport.fastcgi roundtrip ... "uri": "/index.php" ... "env": {"REQUEST_URI": "/test.pdf", ...
3. Caddy version:
v2.6.4
4. How I installed and ran Caddy:
b. Command:
caddy start
wget https://localhost/test.pdf
d. My complete Caddy config:
{
log {
level debug
format console
}
}
localhost {
root * ./www
uri strip_suffix .pdf
php_fastcgi 127.0.0.1:55335
file_server
}