Does the HOWTO transfer the request made by the Apache server to the IIS server without using URL redirection?

My Apache 2.2.9 runs on Debian Lenny 5.0.1 with two network interfaces, one interface has a public IP address and host name, and the other is not configured. This machine serves the services that run on the LAMP stack.

There is a Windows Server 2008 Service Pack 2 (SP2) computer with IIS 7 that serves our ASP.net needs. The box can be configured on both local and public IP addresses, and also has 2 network interfaces.

Both servers serve SSL, while Apache serves open access.

Is there a way when the request, for example https://foo.com/contentfromiis/ , the browser can serve the content from the IIS server without using redirection and transferred to https://bar.com/iwastransferedhere/ . In other words, the user should not / experience / any switch. Thanks!

+3
source share
2 answers

, , mod_proxy, , . , Apache " " , IIS. , HTTP-. mod_proxy docs:

... , . . - . , , .

+6

, . , -. URL-, .

# httpd *reverse proxy caching server* config file for apache httpd 2.2
ServerRoot "C:/Program Files/Apache Group/Apache2"
#must exist, no reason to have anythign in it    
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"

Listen 127.0.0.1:80
Listen 192.168.1.33:80
ServerAdmin stu@thompson.name
ServerName proxy.server.com

LoadModule auth_module modules/mod_auth.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

### PROXY CONFIGURATION  ###
ProxyRequests Off
ProxyVia On

### VH ###
<VirtualHost 192.168.1.33>
    ProxyPass        /  http://192.168.1.34:80/
    ProxyPassReverse /  http://192.168.1.34:80/
    LogLevel info
</VirtualHost>

### LOGGING CONFIGURATION ###
# error log will not catch proxied content
ErrorLog logs/error.log
LogLevel info
LogFormat "%{Host}i %v %h %l %u %t \"%r\" %>s %b  common
CustomLog logs/access.log common
TypesConfig conf/mime.types
+3

Source: https://habr.com/ru/post/1709900/


All Articles