问题
IIS Server is listening Port 80
and Apache is listening 8080
I deployed website on apache.
Domain name is registered on IIS server. How can I redirect to a call from IIS
to Apache server
. Like if I type
www.abc.com
(on IIS), it will redirect call to website on Apache server (on port 8080
)
How can I do that?
回答1:
You need to setup a reverse proxy on IIS and point it to the apache server. Here is a blog post about how to set it up: http://blogs.iis.net/carlosag/archive/2010/04/01/setting-up-a-reverse-proxy-using-iis-url-rewrite-and-arr.aspx
It requires setting up URL Rewrite and Application Request Routing.
Excerpt from the blog post:
The first thing you need to do is enable Proxy support in ARR.
- To do that just launch IIS Manager and click the server node in the tree view.
- Double click the “Application Request Routing Cache” icon
- Select the “Server Proxy Settings…” task in the Actions panel
- And Make sure that “Enable Proxy” checkbox is marked. What this will do is allow any request in the server that is rewritten to a server that is not the local machine will be routed to the right place automatically without any further configuration.
Configure URL Rewrite to route the right folders and their requests to the right site. But rather than bothering you with UI steps I will show you the configuration and then explain step by step what each piece is doing.
Note that for this post I will only take care of Company1, but you can imagine the same steps apply for Company2, and to test this you can just save the configuration file below as web.config and save it in your
inetpub\wwwroot\
or in any other site root and you can test it.
来源:https://stackoverflow.com/questions/19246462/redirect-domain-iis-to-apache