Issue Setting up IIS URL Rewrite Rule --> ARR - iis

Hey everyone it's been a while since I've messed with IIS and I've been asked to implement some changes. (I'm more of a GIS guys then a web admin)
We have a web server humming along at https://my.work.com/
A solution just got deployed to 192.168.1.1:1234/iv
I've verified that the web server can talk to the application server over the correct port and I have a server farm set up in IIS. Our team and clients need to be able to access the solution at https://my.work.com/iv
I'm hitting a wall in setting up my URL rewrite correctly since I'm not 100% sure what the incoming pattern and outgoing path should be. Any help would be appreciated.
IIS Screenshot

Related

Redirect a request to a colud server from a godady server with .htaccess

Hi everyone need your support with the following problem. Please do apologies if I confuse you in anyways with my explanation.
I have a add-on domain (example.com) pointed to a Godaddy Linux server, domain is also in the Godaddy same account.
The web application for "example.com" is a Laravel 5.6 based one, and the web app has 'Get' type search form which needs to be forwarded to another Windows IIS server's port with all the query strings where another web app is hosted. the action of the from will be similar to below.
Request => http://sub1.example.com/route/method?var=val1&var2=val2&var3=val3
From this point on-wards the application has to continue work from the IIS server with the subdomain, which mean I am not expecting any replies from this IIS server to the Linux server.
Its been advised to use the subdomain to mask the forwarding to the IIS server, so I did like above with sub1 sub-domain. This subdomain has to be forwarded to a server's port as I mentioned above, something similar to below.
http://sub1.example.com => http://xxx.xxx.xxx.xx:9596
I did tried with the Godaddy's default subdomain forwarding with masking, but the query strings are not being forwarded and shows "Destination Unknown" error.
In a online forum its been advised not to go with Godaddy's forwarding instead go with .htaccess to have more control.
Therefore any possible solutions or your support with the redirection with .htaccess from web application to the external web server's specific port along with the query strings would be a life saver.
Thank you in advance.
As per the GoDaddy support, the domain forwarding to a IP's port is not possible with the Shared hosting.
The support suggested to go-ahead with the VPS and configure.
Please do comment, if this is wrong statement!

Application Request Routing: Why some sites return HTTP 404 some don't?

I want to add a load balancer to an existing asp.net project using Application Request Routing. So I made myself familiar with the concepts and created a local test-setup:
IIS locally running on Windows 10:
Installed Application Request Routing 3.0 with Windows Platform Installer
Created server farm with following servers:
<test-server-name>.de (Microsoft 2012 R2 Server: contains the asp.net project)
www.google.com (just to see if load balancing and url rewriting works because I don't have two test servers available)
URL-Rewriting rule:
After typing localhost multiple times in any browser, I can see that load balancing (weighted round robin) is working fine. It's alternating between 1. and 2. website.
The problem I'm facing is a 404 Error on both websites.
I already tried the following:
Installing and enabling Failed Request Tracing Rules (on local IIS): URL Rewriting is working properly i think.
Failed Request Log for www.google.com: google drive, unzip and open xml in e.g. IE for better view
Create Server Farm without automatic creation of URL Rewrite rules
(selecting No and create own URL Rewrite rule)
Change "Managed Pipeline Mode"-setting of Applcation Pool from Integrated to Classic
Healthcheck on other Websites I have absolutly no clue why it's working on Git-websites and why facebook is returning a 400 error code.
Enabling/disabling proxy (IIS-Manager -> Application Request Routing Cache -> Server Proxy Settings...)
I don't know what i could do next, so I appreciate any help. Thanks.
Answer can be found here: https://forums.iis.net/t/1238739.aspx?Why+some+sites+return+HTTP+404+some+don+t+
Some websites simply don't support localhost as hostname, which is why localhost can't be found (error 404) e.g. on google.com
Detailed answer if link above is not working in future:
That is not an effective test.
What you are doing is sending the hostname of your request to the third party servers. Like Google.
So if your request is say http://example.com you are sending this to say www.google.com and the Google servers will likely reject this as you can see
Web server admins generally don't let themselves receive traffic from domain thet do not host.
If you sent a request to my servers IP with mysite.com I too would likely reject it. (Things get complex if you have wildcard sites and you allow all traffic through)
But simply showing that 404 page from Google means tour request hit there server so that implies ARR is working.
If you really wanted to test it this way have a local host file with www.google.com resolving to your servers IP. Set up a site with www.google.com as the hostheader and then you should see the correct info hitting Google. But there is no accounting for what 3rd party admins do on their side.

IIS reverse proxy not working in Azure Web App

I want to use a reverse proxy to point one of my endpoints to a resource that's hosted elsewhere. My primary server (where everything else is hosted) is in an Azure Web App and is otherwise working perfectly.
I've been using this seemingly failproof article along with the other links mentioned at the bottom of it: https://blogs.msdn.microsoft.com/zhiliang_xus_blog/2016/01/19/build-a-google-reverse-proxy-site-on-azure-web-app-in-less-than-3-minutes/
As a baseline, I used a Web App with no additional code and confirmed that the reverse proxy works. This was done by manually creating/editing the web.config file and applicationHost.xdt file then restarting the server.
I've tried 3 separate approaches (all on clean, new web apps) all of which are failing for me:
Push my code, confirm it works, then follow the reverse proxy steps manually
Follow the steps manually, confirm reverse proxy works, then push my code
Put the reverse proxy files into my codebase and push everything at the same time
None of these 3 approaches are working. Is this a bug in Azure? How can I try to figure this out?
Post XML Transformation (XDT), have you restarted the site?
I would suggest you to take a look at this blog from Ruslan:
http://ruslany.net/2014/05/using-azure-web-site-as-a-reverse-proxy/
It talks about using a Site extension. It implements the reverse proxy and it does the XDT transformation for you.
If the above is setup correctly, then there is something wrong with the URL Rewrite rules. I would recommend you to enable Failed Request Tracing and debug this further.
The link/way you posted used URL Rewrite to implement a reverse proxy. I tested it and it worked fine with my empty web application. After published a web application to the Azure Web App(For example, an ASP.NET MVC web application), the URL Rewrite stopped working. The reason is that all the requests to your web application are routed by ASP.NET route module.
To enable URL Rewrite for some URLs, we need to disable ASP.NET route for these URLs. For example, if you want to rewrite all the requests with "product/xxx" format to another site. You could add following code to RouteConfig.cs file.
routes.Ignore("product/{action}");
The problem in this specific case was the location of my web.config file.
It needs to be in the root directory of the application which, in my case, was not site\wwwroot. My code was being generated and copied into site\wwwroot\dist. Putting the config file in that directory fixed the problem.
Additionally, there are logs that can be enabled to get some insight as to what's going on: https://learn.microsoft.com/en-us/azure/app-service-web/web-sites-enable-diagnostic-log

Sub-domain on a dedicated server

I don't know if my title made any since because I'm not sure what the terminology for what I'm trying to do is. Let me just explain my situation and see if anyone can shed light on to what to do next.
So I'm working on a research grant and we've got a shared server with GoDaddy currently serving our domain(also managed by GoDaddy). We also have a dedicated server through GoDaddy that we are using to do heavy computations on the research side of things. What I need to do is tie a sub-domain (say research.ourdomain.org) to the dedicated server. I tried sub domain-forwarding and Masking (forwarded to a Silverlight app) and this works until someone tries to request a page outside of our Silverlight app(at which point it first hits the Silverlight app then goes to a blank page). I feel like I'm going in the wrong direction with sub-domain forwarding and masking. Is their a better way to achieve what I need?
I hope that question wasn't too convoluted.
You can do this without forwarding and masking. All you need to do is setup the server to host the subdomain. Then you will need to create the A record in your DNS control and point it to your server IP. The link, http://x.co/ZmgJ, will have more info on how to create that record. If you need server assistance, http://x.co/ZmgM can show you how to initiate live chat with our server conceirges.

HTTP 404 error while trying to browse web site created on IIS 7.5

I am completely newbie with IIS. I have Win2008 with IIS 7.5 installed. I can start "Default Web Site" via IIS Manager GUI , but I get "HTTP 404 error - webpage cannot be found" while trying to browse it. What webpage is expected ? I have index.htm & default.aspx under c:\inetpub\wwwroot ... Also , I am not sure where to look for the logs. What is the best way to troubleshoot? Thanks for you help!
Are you sure you are accessing you website through out the good port? Check in your IIS configuration for your default web site, maybe it is not set to port 80 (which should be the default).
Also, many other programs like Skype may use this port already and IIS is not able to activate the website because the port is already in use.
You should try to set the IIS default website port to something else than 80.
Give it a try!
Check your default website mode, I guess its process was stopped. Try to restart the process. If you get any "Process is being used" error, try to close the exe's like skype of any third parties which refer the 80 port.

Resources