+ Post New Thread
Results 1 to 10 of 10
Internet Related/Filtering/Firewall Thread, Reverse proxy - ASPX issue? in Technical; Hi all, hope someone is daft enough to be viewing these forums today! We have an Apache webserver sat on ...
  1. #1

    Join Date
    May 2010
    Location
    Stoke on Trent
    Posts
    91
    Thank Post
    10
    Thanked 4 Times in 4 Posts
    Rep Power
    10

    Reverse proxy - ASPX issue?

    Hi all, hope someone is daft enough to be viewing these forums today!

    We have an Apache webserver sat on an Ubuntu machine, it's happily dishing out our website, Moodle, Intranet.
    The school wants me to test the 'Insight' SIMS interface software, this needs to run on an IIS webserver

    I've set up Insight and it works (locally) to make it available from our website I've set up a reverse proxy on Apache. The reverse proxy points to Insight and also a test website that contains one basic HTML page.

    When I test the test website, it works fine which means my reverse proxy is set up correctly (mod_proxy enabled etc) However it falls over when I try to access the Insight bit.

    What happens is the request from Apache to IIS for the Insight homepage (Secure.aspx) goes through correctly - this should return a login page... instead, whatever is passed back to Apache seems to cause it to look for a page internally and it throws a 404 error

    'The requested URL /secure.aspx was not found on this server'

    I'm presuming the problem is something to do with aspx but I really don't have a clue!

    Can anyone point me in the right direction? I've been searching Google but I'm going nowhere fast

    Cheers... and Happy New Year!

  2. #2

    Join Date
    May 2010
    Location
    Stoke on Trent
    Posts
    91
    Thank Post
    10
    Thanked 4 Times in 4 Posts
    Rep Power
    10

    More info

    Oh yeah... just so you know...

    It's IIS 6 with ASP.NET 4

    I've set the ports up for the test website & Insight - I'm not using port 80

    Oh yeah... just so you know...

    It's IIS 6 with ASP.NET 4

    I've set the ports up for the test website & Insight - I'm not using port 80

  3. #3

    Join Date
    May 2010
    Location
    Stoke on Trent
    Posts
    91
    Thank Post
    10
    Thanked 4 Times in 4 Posts
    Rep Power
    10

    and theres more...

    Ah, I may have an idea of what's going on... hopefully someone who knows a bit more than me can confirm if I'm on the right track...

    My test website is in a folder called TestRP, my reverse proxy pushes all traffic with the url http://mywebsite.com/TestRP through to this site on IIS6. This works, when I type http://mywebsite.com/TestRP in my browser it displays the TestRP test page and the url displayed in the browser remains http://mywebsite.com/TestRP

    My Insight website should work exactly the same but it falls over. When I type http://mywebsite.com/insight into my browser, I'm routed through to IIS6 correctly but the aspx page that it opens, returns a url that doesn't explicitly reference the folder (called insight) that it's sitting in. This url is passed to Apache that can no longer reverse proxy it and instead throws a 404 page not found error

    this is what is displayed in the address bar : http://mywebsite.com/secure.aspx?ReturnUrl=%2f

    And the page displayed tells me

    Not Found : The requested URL /secure.aspx was not found on this server.

    OK folks, can anyone tell me if:

    A) I'm on the right track with this and...
    B) How to resolve the issue... without digging into someones ASP code!

    Cheers... and Happy New Year!

  4. #4
    hit
    hit is offline
    hit's Avatar
    Join Date
    Mar 2008
    Location
    London
    Posts
    326
    Thank Post
    49
    Thanked 50 Times in 48 Posts
    Rep Power
    51
    Looks to me that your reverse proxy isn't set up right to re-write the header. The a,dress you should see in your browser should be [url]http://mywebsite.com/insight/secure.aspx?...

    This page should be a good start, can you post the directives you have used?

    Apache module mod_proxy
    Last edited by hit; 2nd January 2012 at 07:19 PM. Reason: Ipad messing up formatting!

  5. #5

    Join Date
    May 2010
    Location
    Stoke on Trent
    Posts
    91
    Thank Post
    10
    Thanked 4 Times in 4 Posts
    Rep Power
    10

    Reverse Proxy issue

    Quote Originally Posted by hit View Post
    Looks to me that your reverse proxy isn't set up right to re-write the header. The a,dress you should see in your browser should be [url]http://mywebsite.com/insight/secure.aspx?...

    This page should be a good start, can you post the directives you have used?

    Apache module mod_proxy
    Thanks for the response, I've got this code in the Apache httpd.conf file

    ProxyRequests Off
    ProxyPreserveHost On
    <Proxy *>
    Order deny,allow
    Allow from all
    </Proxy>

    ProxyPass /insight http://iiserver:123/INSIGHT/
    ProxyPassReverse /insight http://iiserver:123/INSIGHT/

    ProxyPass /TestRP http://iiserver:124/TestRP/
    ProxyPassReverse /TestRP http://iiserver:124/TestRP/

    <location /web>
    Order allow,deny
    Allow from all
    </location>

    I've set up mod_proxy (which must be working to some extent because TestRP returns the correct page) and proxy_http...

  6. #6
    Cache's Avatar
    Join Date
    Apr 2008
    Location
    Cumbria
    Posts
    1,304
    Thank Post
    487
    Thanked 190 Times in 184 Posts
    Blog Entries
    3
    Rep Power
    67
    Don't know because I've never looked at mod_proxy before so this is a guess.

    I think your httpd.conf might need to read like the following:

    Code:
    ProxyRequests Off
    ProxyPreserveHost On
    <Proxy *>
    Order deny,allow
    Allow from all
    </Proxy>
    
    ProxyPass /insight/ http://iiserver:123/INSIGHT/
    ProxyPassReverse /insight/ http://iiserver:123/INSIGHT/
    
    ProxyPass /TestRP/ http://iiserver:124/TestRP/
    ProxyPassReverse /TestRP/ http://iiserver:124/TestRP/
    
    <location /web>
    Order allow,deny
    Allow from all
    </location>
    a trailing / on the url that you are proxying. Presumably what is happening is you are navigating to mywebsite.com/insight and it apache is seeing it as the root, so when the url is returned, it then looks for the url on the local apache server rather then proxying it.

    Could be completely off though (as I say, I've never used it).

  7. #7
    hit
    hit is offline
    hit's Avatar
    Join Date
    Mar 2008
    Location
    London
    Posts
    326
    Thank Post
    49
    Thanked 50 Times in 48 Posts
    Rep Power
    51
    Ah, perhaps the issue is that links are not being re-written in the HTML, try adding this directive:

    ProxyHTMLURLMap http://iisserver:123/INSIGHT /insight

    It's been ages since I've had to do this, I have an example on of the servers at work somewhere, will try to dig it out tomorrow.

  8. #8
    hit
    hit is offline
    hit's Avatar
    Join Date
    Mar 2008
    Location
    London
    Posts
    326
    Thank Post
    49
    Thanked 50 Times in 48 Posts
    Rep Power
    51
    Oh, and you probably need this:

    ProxyHTMLEnable On

  9. #9

    Join Date
    May 2010
    Location
    Stoke on Trent
    Posts
    91
    Thank Post
    10
    Thanked 4 Times in 4 Posts
    Rep Power
    10

    Reverse Proxy issue

    Quote Originally Posted by hit View Post
    Oh, and you probably need this:

    ProxyHTMLEnable On
    Thanks! I've just tried adding the trailing '/' and that didn't make any difference, I'll try the ProxyHTMLEnable tomorrow when I get into work. I don't have a great deal of experience with web servers but I can't help thinking the problem is with the ASPX code... Instead of opening a page directly, it's chucking a URL back at the proxy that doesn't contain the '/insight/' part so the Apache server thinks it's a local page that it can't find... hopefully I'll be proved wrong tomorrow!

    Cheers for all your help, much appreciated.

  10. #10


    tom_newton's Avatar
    Join Date
    Sep 2006
    Location
    Leeds
    Posts
    4,507
    Thank Post
    871
    Thanked 862 Times in 681 Posts
    Rep Power
    199
    Generally, with RProxies it is best to do something like testrp.mydomain.com and insight.mydomain.com - rather than use subfolders, as this removes the need for a lot of rewriting or for the aspx to "understand" it is being proxied (the webservers can happily have a domain a piece) and then you use the rproxy to share 2 domains on one IP and the same port.

    Does that make sense?



SHARE:
+ Post New Thread

Similar Threads

  1. Reverse Proxy issues
    By climo in forum Yorkshire & Humberside Grid for Learning (YHGfL)
    Replies: 3
    Last Post: 23rd April 2011, 09:07 AM
  2. Reverse proxying SSH...
    By Joedetic in forum Wireless Networks
    Replies: 7
    Last Post: 6th August 2007, 12:56 PM
  3. Reverse Proxy and Moodle
    By wesleyw in forum How do you do....it?
    Replies: 3
    Last Post: 11th June 2007, 02:49 PM
  4. Reverse Proxying with Apache.
    By maniac in forum Web Development
    Replies: 7
    Last Post: 5th April 2007, 12:04 PM
  5. reverse proxy ajax apps
    By CyberNerd in forum Web Development
    Replies: 3
    Last Post: 15th June 2006, 08:32 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •