<div dir="ltr">Hi,<br><div><br></div><div>I am running the <span class="gmail-il">nginx</span> version: <span class="gmail-il">nginx</span>/1.22 as a reverse proxy server on CentOS Linux release 7.9.2009 (Core). Is there a way to return json response when i hit <a href="http://mydomain.com/api/v1/*">http://mydomain.com/api/v1/*</a> instead of the html response.</div><div><br></div><div>location /api/v1/* {<br>    internal;<br>    add_header 'Content-Type' 'application/json charset=UTF-8';<br><br>    error_page 502 '{"error": {"status_code": 502,"status": "Bad Gateway"}}';<br>}<br><br>But whenever I try to send a request to /api/v1/users via curl I get the HTML source code in response instead of JSON response. <br></div><div><br></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><br></div><div><br></div></div>