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

nginx.conf.sample from 2.4.6-p1 causes problems with running app continer #958

Open
redo-interactive opened this issue Jul 7, 2023 · 5 comments

Comments

@redo-interactive
Copy link

Description
While installing fresh vanilla magento 2.4.6-p1 app container is off. With error that in nginx.conf in line 50 there is a problem with php-fpm. There are 3 lines with php-fpm.

When exchanging content from nginx.conf.sample from 2.4.6 it is working fine.

Steps To Reproduce

  1. Install fresh version of 2.4.6-p1
  2. Check running containers, app should be off.

Expected Result
Application should be working fine, site magento.test should be accessible

Actual Result
App container is off with an error related to /var/www/html/nginx.conf. Application isn't accessible.

@markshust
Copy link
Owner

@redo-interactive thank you, I have confirmed this is an issue.

To additionally confirm the issue, everything works for you when the nginx.conf.sample from 2.4.6 is copied over to the 2.4.6-p1 install?

@redo-interactive
Copy link
Author

@markshust yes, I have just done that and the project on 2.4.6-p1 works as it should.

@janmyszkier
Copy link

janmyszkier commented Jul 13, 2023

TL;DR:
change php-fpm:9000 to fastcgi_backend in your nginx.conf.sample within your project root and run

bin/copytocontainer nginx.conf.sample
bin/restart app

Bigger note on this:
2.4.6-p1 comes with

        fastcgi_pass   php-fpm:9000;

where 2.4.6

        fastcgi_pass   fastcgi_backend;

and conf from 2.4.6 works because the nginx image provides fastcgi_backend in:
https://github.com/markshust/docker-magento/blob/master/images/nginx/1.18/conf/default.conf#L1

but nothing provides php-fpm backend definition.

This COULD be scripted to check whether the backend under the name from nginx.conf.sample exists (with bash) and added as a new script like check-requirements within the bin dir just like other commands BUT the nginx.sample should never be used for real setup, because you should just copy the sample and modify it to your need.
SO I guess, it would be probably better for the repo to provide it's own nginx.conf (and not use the sample) and copy it to the project directory as a part of the setup.

@piotrkwiecinski
Copy link
Contributor

https://experienceleague.adobe.com/docs/commerce-operations/release/notes/security-patches/2-4-6-p1.html this is a known issue:

The nginx.sample file was inadvertently updated with a change that modifies the value of fastcgi_pass from fastcgi_backend to php-fpm:9000. This change can be safely reverted or ignored.

I would expect it'll be reverted in next update.

@piotrkwiecinski
Copy link
Contributor

Looks like it was fixed in https://experienceleague.adobe.com/docs/commerce-operations/release/notes/security-patches/2-4-6-p2.html
@markshust maybe it's worth bumping defaults to p2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants