0

I keep getting a 203 error from NGINX and could use some help resolving it. I get this error when I go to http://localhost, http://localhost/index ... etc. The site works perfectly fine.

[error] 60#60: *203 FastCGI sent in stderr: "PHP message:" while reading response header from upstream, client: ::1, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "localhost"
2019/10/25 13:34:35 [error] 60#60: *203 FastCGI sent in stderr: "PHP message:" while reading response header from upstream, client: ::1, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "localhost", referrer: "http://localhost/"

Conf:

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /mnt/c/Users/me/src/site;

        # Add index.php to the list if you are using PHP
        index index.php index.html index.htm index.nginx-debian.html;


        server_name _;


location / {
                try_files $uri $uri/ /index.php$is_args$args;
        }

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;

                # Make sure unix socket path matches PHP-FPM configured path above
                fastcgi_pass unix:/run/php/php7.2-fpm.sock;

                # Prevent ERR_INCOMPLETE_CHUNKED_ENCODING when browser hangs on response
                fastcgi_buffering off;
        }

}

I'm assuming it might have something to do with this: Strange Nginx behavior with trailing slashes. But I don't fully understand.

ouflak
  • 2,458
  • 10
  • 44
  • 49
Chemdream
  • 618
  • 2
  • 9
  • 25
  • Try adding this below server_name: `error_log /var/log/nginx/error.log error;`, restart nginx, and see if that error log give you more information. – aynber Oct 25 '19 at 17:57
  • Added and restarted NGINX, no change. However, I am noticing my routes aren't working. There must be something off in the config... – Chemdream Oct 25 '19 at 18:21
  • That line won't make it start working, but it should hopefully write better error messages to that error log. Check the log to see if it gives any more information. – aynber Oct 25 '19 at 18:22
  • The error is actually from PHP, emitted over stderr and relayed to Nginx by php-fpm. You could try configuring PHP to write errors to its own error log file rather than writing them to stderr. Check the `php.ini` file and directives such as `log_errors` and `error_log`. – Richard Smith Oct 25 '19 at 19:06
  • log_errors is on. error_log is set to the default file. I do see php errors (like from code) in the php log. – Chemdream Oct 25 '19 at 19:16
  • Another strange I noticed. Now, if I go to localhost, it downloads the php file. But if I go to localhost/login, it loads the default (not login) controller. Argh! – Chemdream Oct 25 '19 at 19:18
  • NM the last comment, it was a browser cache issue. – Chemdream Oct 25 '19 at 19:27
  • 1
    I had a few small things wrong. But the accepted answer answered the question I actually asked. Thanks! – Chemdream Oct 27 '19 at 21:24

1 Answers1

1

A HTTP Proxy sits in the middle between a client and a server (origin). In some cases a HTTP Proxy might make changes to the response before it reaches the client.

So, you are realy shure what you are get 203 error come from YOUR nginx-server?