<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <font face="Helvetica, Arial, sans-serif">Error page doesn't allow a
      string content as return (at least it's not documented as being
      valid).<br>
      <br>
      Try:<br>
      <br>
      location /apis/* {<br>
          add_header 'Content-Type' 'application/json charset=UTF-8';<br>
          return 500 '{"error": {"status_code": 500,"status": "Internal
      Server error"}}';<br>
      }<br>
      <br>
      -Dan<br>
    </font><br>
    <div class="moz-cite-prefix">On 11/7/2022 12:47 PM, Kaushal Shriyan
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAD7Ssm_vhBXC2tYMg3FOr9feXqbUDE-MZmUQ-dfc7cQQJZi2UQ@mail.gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr"><br>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Mon, Nov 7, 2022 at 9:40
            PM Dan G. Switzer, II <<a
              href="mailto:dan.switzer@givainc.com"
              moz-do-not-send="true" class="moz-txt-link-freetext">dan.switzer@givainc.com</a>>
            wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">
            <div> <font face="Helvetica, Arial, sans-serif">The
                "internal" keyword indicates only internal request can
                access the location:<br>
                <br>
                <a
href="https://url.emailprotection.link/?bKzOBHGoVTgMZbVl06OjtjX6aHusF64x7ioKV57xsa8lK5HrhUog6H03w4i49Ibf0uYwbM9e74mZ2RElJBcCfPJ4yQW6AkMPmgxM2SKhEDl3WxQF7mffOIcAwcvVg3N1I"
                  target="_blank" moz-do-not-send="true">http://nginx.org/en/docs/http/ngx_http_core_module.html#internal</a><br>
                <br>
                So hitting ttp://<a
href="https://url.emailprotection.link/?bwxIfDuJKR1YH1mqneKAbav55uYd8-63cvdvlSLvw0mVdAEtaFGRd2iiGoI8nWnhImkBUGplq84IGc2dX0eDK2g~~"
                  target="_blank" moz-do-not-send="true">mydomain.com/api/v1/*</a> 
                with CURL would never hit this location.<br>
                <br>
                Remove the "internal" keyword, reload Nginx and try it
                again.<br>
                <br>
                -Dan<br>
              </font></div>
          </blockquote>
          <div><br>
          </div>
          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. 
          <div><br>
          </div>
          <div><u>/var/log/nginx/access.log<br>
            </u></div>
          <div>48.219.29.210 - - [07/Nov/2022:17:33:38 +0000] "POST
            /apis HTTP/1.1" 500 1678279 "-" "PostmanRuntime/7.29.2" "-"<br>
          </div>
          <div><br>
          </div>
          <div><u>Response in html format</u></div>
          <div><u><br>
            </u></div>
          <div>############################################################################################################</div>
          <div><!doctype html><br>
            <html lang="en"><br>
            <br>
            <head><br>
            <title>500</title><br>
            <meta charset="utf-8"><br>
            <meta name="description" content="500"><br>
            <link rel="preconnect" href="<a
href="https://url.emailprotection.link/?by-dLw9LwJmO5vEZpHedagRmqu5Hzr5-4SwcSmbg7a4wCJN60WQwnE73R4jiVqy2JURqdMNsclU-C1XzywjIrkQ~~"
              moz-do-not-send="true">https://fonts.gstatic.com</a>"><br>
            <meta name="viewport" content="width=device-width,
            initial-scale=1.0"><br>
            <link rel="icon" href="favicon.ico" type="image/gif"
            sizes="32x32"><br>
            <style><br>
            @font-face {<br>
            font-family: "UniversNextHSBC-Light";<br>
            src:
url("/themes/custom/gsmamarketplace/font/UniversNextforHSBCW29-Light.woff2")
            format("woff2");<br>
            }<br>
            <br>
            <br>
            </div><br>
                        <div class="error-content"><br>
                            <h1>500 <br> Internal server
            problem</h1><br>
                                <p>Sorry, An error occurred and
            your request couldn't be completed. <a href="/">Return
            to the home<br>
                                        page</a></p><br>
                        </div><br>
                    </div><br>
                </div><br>
            </body><br>
            </html><br>
          </div>
          <div><br>
          </div>
          <div>############################################################################################################<br>
          </div>
          <div><br>
          </div>
          <div>
            <div>Please guide me. Thanks in advance. I look forward to
              hearing from you. </div>
            <div><br>
            </div>
            <div>Best Regards,</div>
            <div><br>
            </div>
            <div>Kaushal</div>
          </div>
          <div> </div>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
nginx mailing list -- <a class="moz-txt-link-abbreviated" href="mailto:nginx@nginx.org">nginx@nginx.org</a>
To unsubscribe send an email to <a class="moz-txt-link-abbreviated" href="mailto:nginx-leave@nginx.org">nginx-leave@nginx.org</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Dan G. Switzer, II
Giva, Inc.
Email:    <a class="moz-txt-link-abbreviated" href="mailto:dan.switzer@givainc.com">dan.switzer@givainc.com</a>
Web Site: <a class="moz-txt-link-freetext" href="http://www.givainc.com">http://www.givainc.com</a>

See Our Customer Successes 
<a class="moz-txt-link-freetext" href="http://www.givainc.com/customers-casestudies.htm">http://www.givainc.com/customers-casestudies.htm</a>
</pre>
  </body>
</html>