Jslfl【软件开发技术笔记】

Apache HTTP server反向代理配置记要

Listen 80

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

#代路径的代理要放前面
#访问url:192.168.1.2/web1
ProxyPass /web1 http://192.168.1.2:8080/web1
ProxyPassReverse /web1 http://192.168.1.2:8089/web1

#访问url:192.168.1.2/web2
ProxyPass /web2 http://192.168.1.2:8080/web2
ProxyPassReverse /web2 http://192.168.1.2:8089/web2

#访问url:192.168.1.2/web3
ProxyPass /web3 http://192.168.1.2:8081/web3
ProxyPassReverse /web3 http://192.168.1.2:8081/web3

#访问url:192.168.1.2/web4
ProxyPass /web4 http://192.168.1.5:80/web4
ProxyPassReverse /web4 http://192.168.1.5:80/web4

#访问url:192.168.1.2/web5/192.168.1.2/web6
ProxyPass / http://192.168.1.2:8081/
ProxyPassReverse / http://192.168.1.2:8081/

##域名访问
NameVirtualHost *:80

ServerName www.website1.com
ServerAlias website1.com
ProxyPass / http://192.168.1.2:8082/
ProxyPassReverse / http://192.168.1.2:8082/


ServerName www.website2.com
ServerAlias website2.com
ProxyPass / http://192.168.1.2:8083/
ProxyPassReverse / http://192.168.1.2:8083/

Comments are currently closed.