Skip to content
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

fastcgi: Implement try_files override in Caddyfile directive #4347

Merged
merged 1 commit into from
Sep 17, 2021

Conversation

francislavoie
Copy link
Member

See #4344, this is part 2 of completing that issue. This should be merged after #4346.

This makes it possible to override the try_files logic in the php_fastcgi directive, without having to implement a try_files to run before php_fastcgi (plenty of examples of users doing this on the forums, where their PHP apps didn't quite conform to what they needed).

It makes the following config possible:

:8080 {
	root * /srv
	php_fastcgi localhost:9000 {
		try_files {path} {path}/index.php =404
	}
	file_server

	handle_errors {
		respond "Error!"
	}
}

@francislavoie francislavoie added the under review 🧐 Review is pending before merging label Sep 12, 2021
@francislavoie francislavoie added this to the v2.5.0 milestone Sep 12, 2021
@francislavoie francislavoie changed the title caddyhttp: Add support for triggering errors from try_files fastcgi: Implement try_files override in Caddyfile directive Sep 12, 2021
@francislavoie
Copy link
Member Author

@mholt with #4346 merged, this is ready to go

Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for the test.

@mholt mholt merged commit 3f2c3ec into master Sep 17, 2021
@mholt mholt deleted the php-fastcgi-try-files branch September 17, 2021 14:23
@mholt mholt removed the under review 🧐 Review is pending before merging label Sep 17, 2021
@francislavoie francislavoie modified the milestones: v2.5.0, v2.4.6 Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants