nginx returns html instead of json response

Kaushal Shriyan kaushalshriyan at gmail.com
Wed Nov 23 17:57:35 UTC 2022


On Wed, Nov 23, 2022 at 11:20 PM Francis Daly <francis at daoine.org> wrote:

> On Tue, Nov 22, 2022 at 07:52:41PM +0530, Kaushal Shriyan wrote:
>
> Hi there,
>
> > map $sent_http_content_type $enableerror {
> >     default                    on;
> >     application/json          off;
> > }
>
> I believe that from a timing point of view, that variable is not going
> to have a useful value when you want to use it.
>
> > I have attached the nginxtest.conf file for your reference. It is not
> > working for me. Am I missing anything? Please guide me.
>
> The test conf file does not appear to include the seven lines that I
> suggested you add.
>
> And "is not working" is an incomplete problem report.
>
> Cheers,
>
>         f
>

Thanks Francis for the quick response.

I am not sure about this line  error_page 555 /dummyfile; what does 555
code mean and what will be the contents of dummyfile?

location ^~ /apis/ {
                fastcgi_intercept_errors off;
                error_page 555 /dummyfile;
                fastcgi_pass 127.0.0.1:9000;
                include fastcgi.conf;
                fastcgi_param SCRIPT_FILENAME
/var/www/html/gsmaidp/web/index.php;
        }

Please guide me.

Best Regards,

Kaushal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20221123/a51236a3/attachment.htm>


More information about the nginx mailing list