-
Notifications
You must be signed in to change notification settings - Fork 31
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
Rewrite to fastcgi #67
Comments
there is diff to achieve that. i never tested it. |
Can't this be done now with rewrite? |
hello, apologies for the necro. is this patch still the way to do this, or is it possible with the current rewrite? |
I'm not sure, check it out, the documentation in OpenBSD is really complete: |
Using the Symfony 5 documentation as a reference, I've come up with this:
I've tested it thoroughly to catch any edge cases, and it seems pretty solid. Explanation for the location blocks:
UPDATE: it's missing one thing:
That is recommended to conceal that you're running PHP. |
New and improved :) # application front controller
location found "/index.php" {
fastcgi socket "/run/php-fpm.sock"
}
# fallback to front controller if the location doesn't exist
location not found "*" {
request rewrite "/index.php"
}
# fallback to front controller if the location is an existing directory
location found "**/" {
request rewrite "/index.php"
}
# if the requested path doesn't match any of the locations above,
# httpd will just serve the resource (e.g. images, css, js, etc.) This handles some edge cases the older one didn't, like when you try to access an existing directory (e.g. I just haven't yet tested it with |
I want httpd to work like this:
In Nginx you do that with a :
In Apache you would do that with a:
I think this is not possible with httpd right now and I am trying to make a patch to support this.
This would make a lot of PHP CMS'es, frameworks, ... work
The text was updated successfully, but these errors were encountered: