Welcome! Log In Create A New Profile

Advanced

Re: nginx modifying the jsonp response message

Maxim Dounin
September 18, 2012 02:56AM
Hello!

On Mon, Sep 17, 2012 at 04:34:27PM -0400, venkat wrote:

> Hi,
>
> We are creating a web api application. In one of our API's if there are any
> validation errors, we are returning the error message in JSONP format. In
> the API Request URL user adds a query string parameter
> ?jsoncallback=xxxxxxxxxx.
>
> On validation failure we are throwing a 400 bad request JSONP with response
> message in the below format.
>
> xxxxxxxxxx({"error","error message"})
>
> It is working good in all the environments, where there is no nginx. In our
> staging environment we have nginx configured.
>
> Here it is modifying the output as below.
>
> badrequest{"error","error message"})
>
> Because of this our front end application is unable to read the response
> message.
>
> Could you please let me know, what configuration setting of nginx could
> cause this problem?

I would suggest that this is caused by error_page 400 +
proxy_intercept_errors configured.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx modifying the jsonp response message

venkat September 17, 2012 04:34PM

Re: nginx modifying the jsonp response message

Maxim Dounin September 18, 2012 02:56AM

Re: nginx modifying the jsonp response message

venkat September 18, 2012 03:03PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 327
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready