Nginx reverse proxy issue

Robin Diederen diederen at nlcom.nl
Wed Jan 26 20:36:41 MSK 2011


Hello Igor,

Thanks so much for your help.

I tried your suggestions but sadly to no result; the ASP.NET app returns the same result.

Now I'm wondering: when I connect to the IIS server by IP instead of its DNS name, I get the same error (only difference is that css works here). My guess would be the server is using name based virtual hosting. 

So I tried to change the Host value in header to the IIS server's DNS name. When I connect to the IIS server, I am redirected to the IIS server. 

What could I do to make this work? I presume this is a general error regarding reverse proxying with name based virtual hosting?

Best, Robin
 
-----Original message-----
To:nginx at nginx.org; 
From:Igor Sysoev <igor at sysoev.ru>
Sent:Wed 26-01-2011 17:37
Subject:Re: Nginx reverse proxy issue
On Wed, Jan 26, 2011 at 02:36:01PM +0100, Robin Diederen wrote:

> Hello all,
> 
> For the last few days I ve been trying Nginx as a reverse proxy in front of an IIS webserver with an ASP.NET webapp. 
> 
> 
> From the Nginx configuration: 
> 
> location / { proxy_pass  http://theproxiedserver/somepath; } 
>  
> 
> When I visit http://nginx I see an error generated by theproxiedserver ; from this I conclude that the basic proxying is working. The error more or less tells me the ASP application has issues fetching its URL. Can I somehow convince Nginx to work around this issue? The IIS server is a blackbox, no modifications can be made there. My stracktrace:
> 
> At X. Suite.ASP.ASPInstance..ctor(String strRootURL)
> 
> at X.Suite.General.GetASPInstanceID()
> 
> at X.Suite.iPortal.Skin.Global_asax.InitializeApplication()
> 
> at X.Suite.iPortal.Skin.Global_asax.Application_BeginRequest(Object sender, EventArgs e)
> 
> at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
> 
> at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Probably you need

location / {
    proxy_pass  http://theproxiedserver/somepath;
    proxy_set_header   Host   thepublicservername;
    # or
    proxy_set_header   Host   $host;
} 


-- 
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx at nginx.org
http://nginx.org/mailman/listinfo/nginx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20110126/c5fb5ae0/attachment.html>


More information about the nginx mailing list