-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to set root inside 'handle_response' block which is in turn inside 'php_fastcgi' directive #4322
Comments
Yeah, I think this is a Caddyfile parsing bug. That said, I don't think this functionality will work the way you expect it to. See #4298 (tl;dr, |
Now I am confused. The code is taken from the example found in the documentation (scroll down to the bottom of the page). And it is titled as 'Custom error page for errors from upstream' (this is exactly what I need). If I don't need the response body, just the status to trigger the appropriate error page, will it be ok to do it like this? Or this example is strictly for 5xx? |
If your upstream writes a response body at all, it won't work, right now. It's a bug. The main usecase we tested for was the |
@francislavoie Thank you for clarification. As I use |
That's the plan, anyways. We don't have a fix yet, that's just the target. |
Alright, I figured out what the actual bug is -- when parsing the tokens inside of Working on a fix. |
Hi, I tried to set up a custom error page based on response status from 'php_fastcgi'. My first attempt was like this:
Since php_fastcgi directive is just a wrapper over a reverse proxy and (as documented here) I expected it should work but got error instead:
Error during parsing: unrecognized directive: /errors
Removing the line
root * /errors
solved the problem, but I needed to point 'file_server' to another directory from web root.So I decided to expand the 'php_fastcgi' directive into respective 'reverse_proxy':
This worked as expected. I think 'php_fastcgi' directive has a bug or am I missing something?
The text was updated successfully, but these errors were encountered: