nginx returns html instead of json response

Kaushal Shriyan kaushalshriyan at gmail.com
Mon Nov 7 17:47:00 UTC 2022


On Mon, Nov 7, 2022 at 9:40 PM Dan G. Switzer, II <dan.switzer at givainc.com>
wrote:

> The "internal" keyword indicates only internal request can access the
> location:
>
> http://nginx.org/en/docs/http/ngx_http_core_module.html#internal
>
> So hitting ttp://mydomain.com/api/v1/*  with CURL would never hit this
> location.
>
> Remove the "internal" keyword, reload Nginx and try it again.
>
> -Dan
>

Thanks Dan for the email response.I am still seeing the below response in
html format. I am attaching the nginxtest.conf file for your reference.


*/var/log/nginx/access.log*
48.219.29.210 - - [07/Nov/2022:17:33:38 +0000] "POST /apis HTTP/1.1" 500
1678279 "-" "PostmanRuntime/7.29.2" "-"

*Response in html format*

############################################################################################################
<!doctype html>
<html lang="en">

<head>
<title>500</title>
<meta charset="utf-8">
<meta name="description" content="500">
<link rel="preconnect" href="https://fonts.gstatic.com">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="favicon.ico" type="image/gif" sizes="32x32">
<style>
@font-face {
font-family: "UniversNextHSBC-Light";
src:
url("/themes/custom/gsmamarketplace/font/UniversNextforHSBCW29-Light.woff2")
format("woff2");
}


</div>
            <div class="error-content">
                <h1>500 <br> Internal server problem</h1>
                    <p>Sorry, An error occurred and your request couldn't
be completed. <a href="/">Return to the home
                            page</a></p>
            </div>
        </div>
    </div>
</body>
</html>

############################################################################################################

Please guide me. Thanks in advance. I look forward to hearing from you.

Best Regards,

Kaushal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20221107/aef313a1/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nginxtest.conf
Type: application/octet-stream
Size: 3646 bytes
Desc: not available
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20221107/aef313a1/attachment.obj>


More information about the nginx mailing list