<div dir="auto">Have you tried enabling "debug" mode logging and checked the log file for more details?<div dir="auto"><br></div><div dir="auto">For example, modify the settings in your nginx.conf and restart the nginx service:</div><div dir="auto"><br></div><div dir="auto"><pre style="margin-top:0px;margin-bottom:0px;border:0px;vertical-align:baseline;width:auto;max-height:600px"><code style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;vertical-align:baseline;white-space:inherit;border-radius:0px">error_log /dev/stdout debug;
http {
access_log /dev/stdout;
...
}</code></pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 15, 2022, 11:23 AM Kaushal Shriyan <<a href="mailto:kaushalshriyan@gmail.com" target="_blank" rel="noreferrer">kaushalshriyan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I am running the nginx version: nginx/1.22 as a reverse proxy server on CentOS Linux release 7.9.2009 (Core). When I hit <a href="http://mydomain.com/apis" rel="noreferrer noreferrer" target="_blank">http://mydomain.com/apis</a> I see the below message on the browser even if the upstream server php-fpm server is up and running. </div><div><br></div><div><i><b>{"errors": {"status_code": 502,"status": "php-fpm server is down"}}</b></i></div><div><br></div><div>I have set the below in the nginx.conf file and attached the file for your reference. </div><div><br></div><div>if ($upstream_http_content_type = "") {<br> add_header 'Content-Type' 'application/json' always;<br> add_header 'Content-Type-3' $upstream_http_content_type$isdatatypejson"OK" always;<br> return 502 '{"errors": {"status_code": 502,"status": "php-fpm server is down"}}';<br> }<br><div><br></div><div># systemctl status php-fpm <br>● php-fpm.service - The PHP FastCGI Process Manager<br> Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)<br> Drop-In: /etc/systemd/system/php-fpm.service.d<br> └─override.conf<br> Active: active (running) since Thu 2022-12-15 15:53:31 UTC; 10s ago<br> Main PID: 9185 (php-fpm)<br> Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec"<br> CGroup: /system.slice/php-fpm.service<br> ├─9185 php-fpm: master process (/etc/php-fpm.conf)<br> ├─9187 php-fpm: pool www<br> ├─9188 php-fpm: pool www<br> ├─9189 php-fpm: pool www<br> ├─9190 php-fpm: pool www<br> └─9191 php-fpm: pool www<br><br>Dec 15 15:53:31 systemd[1]: Starting The PHP FastCGI Process Manager...<br>Dec 15 15:53:31 systemd[1]: Started The PHP FastCGI Process Manager.<br>#<br></div><div><br></div><div>Please guide me. </div><div><br></div><div>Best Regards,</div><div><br></div><div>Kaushal</div><div><pre style="color:rgb(255,255,255);white-space:pre-wrap">{"errors": {"status_code": 502,"status": "php-fpm server is down"}}</pre></div></div></div>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" rel="noreferrer noreferrer" target="_blank">nginx@nginx.org</a><br>
<a href="https://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer noreferrer noreferrer" target="_blank">https://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div>