Problem running nginx in a container
Francis Daly
francis at daoine.org
Wed Feb 9 00:25:23 UTC 2022
On Tue, Feb 08, 2022 at 12:31:55AM -0500, marioja2 wrote:
Hi there,
> error.log.2: https://1drv.ms/u/s!ApcymW6zCVpnuxyYecXcaIlqrVWu?e=WmgaVO
> error.log.1: https://1drv.ms/u/s!ApcymW6zCVpnuxt2oIE3eLklkND0?e=ZlJNGH
> access.log.2: https://1drv.ms/u/s!ApcymW6zCVpnuxgl1jCmHH8O-Pmi?e=GJGQgI
> access.log.1: https://1drv.ms/u/s!ApcymW6zCVpnuxpdqNOQOt3pOMbX?e=Hmtz9Z
These logs show pretty much the same thing, to me: nginx does the same
thing in both cases, and gets different responses from php-fpm.
You'll want to ask php-fpm, or the php code, why that is.
> > That looks like, in both cases, nginx sent a HTTP success (200 OK)
> > message, with differing json body content. One has Result: Attachment;
> > the other has Result: ErrorCode.
> >
> > In both cases, it appears that the response came after nginx wrote the
> > request to the fastcgi server.
>
> I am not sure what you mean by "the response came after nginx wrote the
> request to the fastcgi server". I thought the response is the HTTP response
> to the person that issued the POST (which in my case is another container
> running nginx also) I do not understand what the fastcgi server has to do
> here. I do not understand the configuration in rainloop.conf for the php-fpm
> stuff nor do I understand where it plays in the whole transaction.
The client/browser makes a HTTP POST request to nginx.
Because of the nginx configuration, nginx knows to handle that request by
acting as a fastcgi client, and making a fastcgi request to the fastcgi
server that is listening on the unix-domain socket /var/run/php7-fpm.sock.
That fastcgi server does whatever it wants, and sends a response to nginx.
nginx sends a modified version of that response back to the client.
In one case, the response from the fastcgi server is some JSON that says
things worked; in the other, it is some JSON that says the input file
was too big.
Also in one case, the response headers include "X-Powered-By: PHP/7.4.26",
and in the other case, they do not. Under what circumstances will your
fastcgi server not return the X-Powered-By header? Those circumstances
happen in error_log.2 above, and not in error_log.1.
Searching the web for "File is too big" and rainloop does offer some
php.ini-config suggestions. (One of the earlier suggestions was that
the same file content, but uploaded with a shorter file name, would work.)
Is there any chance that your php-fpm service acts differently between an
"up" and a "restart"?
Good luck with it,
f
--
Francis Daly francis at daoine.org
More information about the nginx
mailing list