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

fix: include a complete fastcgi_params config #2449

Merged
merged 1 commit into from
May 17, 2024
Merged

fix: include a complete fastcgi_params config #2449

merged 1 commit into from
May 17, 2024

Conversation

buchdag
Copy link
Member

@buchdag buchdag commented May 16, 2024

Rebase of #2011 by @rodrigoaguilera

Should fix #1466

@buchdag buchdag added the type/fix PR for a bug fix label May 16, 2024
@buchdag buchdag self-assigned this May 16, 2024
@buchdag buchdag linked an issue May 16, 2024 that may be closed by this pull request
@buchdag
Copy link
Member Author

buchdag commented May 16, 2024

@rodrigoaguilera @tkw1536 I'm really unfamiliar with PHP-FPM, before I merge this could you explain to me what is the effect of

fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;

because this additional line is the only difference between the fastcgi_params and the fastcgi.conf files.

By merging this, isn't it possible that we break setup that worked with fastcgi_params but won't with fastcgi.conf ?

I've also seen this mentioned as a possible fix instead of the former line in #1466:

fastcgi_param  SCRIPT_FILENAME    $request_filename;

Is it the same ?

@rodrigoaguilera
Copy link
Contributor

rodrigoaguilera commented May 17, 2024

The SCRIPT_FILENAME in fastcgi.conf is more complete and it is suited for more complex apps such as Drupal, WordPress or Laravel.

The variation that only uses $request_filename might be enough for apps that work with a single index.php without request query arguments.
http://nginx.org/en/docs/http/ngx_http_core_module.html#variables

Using $fastcgi_script_name is better since it takes care of things like adding index.php to the variable passed onto the fpm engine.
https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html

I see a remote chance of breaking if someone specified in their nginx fastcgi_params and then the include the fastcgi.conf to overwrite those but I regard that as highly unlikely.

Thank you for keeping the project maintained.

Copy link
Contributor

@rodrigoaguilera rodrigoaguilera left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@buchdag
Copy link
Member Author

buchdag commented May 17, 2024

Thanks for the explanation, seems safe to merge to me 👍

@buchdag buchdag merged commit 57501eb into main May 17, 2024
4 checks passed
@buchdag buchdag deleted the fix-fastcgi branch May 17, 2024 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/fix PR for a bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP-FPM with suggested ReadMe setup doesn't work fastcgi does not work
2 participants