0

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 like this.

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?

Thanks in Advance

Venkat.

4

1 に答える 1

0

Actually the problem is not due to nginx.

It is due to IIS 7.5 in our staging server which is causing the problem.

Below configuration change in web.config has fixed it.

<httpErrors errorMode="Detailed" />

于 2012-09-18T19:06:01.080 に答える