Fastcgi header_upstream support (maybe feature request)

(Viliam Kopecký) #1

WordPress doesnt recognize Caddy, so I would like to simulate fastcgi as nginx, which should be by changing a Server header to nginx value.

I would expect the something like header_upstream Server nginx for proxy configuration to work with fastcgi.

Something like this

:2015 {
	fastcgi / php {
		header_upstream Server "nginx/caddy"

(Matthew Fay) #2

I didn’t think HTTP headers existed in the context of a FastCGI proxy, or that WordPress “recognises” any web server via FastCGI…

The closest analogue available to you would be setting an environmental variable with env, but I can’t imagine how it would help with whatever issue you’re having.

(Viliam Kopecký) #3

Im not sure either. But echo $_SERVER['SERVER_SOFTWARE']; does really output Caddy/0.10.7 - so Caddy must somehow modify the headers.

PHP documentation mentions the source of that constant is from the headers.

(Matthew Fay) #4

Those are set here, as environmental variables:

You should be able to use env to override or set additional variables, which happens here, shortly after the above:

Are you able to elaborate on how this would fix your issue with Caddy/WordPress?

(Viliam Kopecký) #5

Thank you, this solved my issue :slight_smile:

:2015 {
	fastcgi / php {
		env SERVER_SOFTWARE "nginx/caddy"

(system) #6

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.