You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ServerName a.com
ProxyPreserveHost On
ProxyRequests Off
Order deny,allow
Allow from all
ProxyPass / http://192.168.0.10/
ProxyPassReverse / http://192.168.0.10/
反向代理:
适用情况:
具体设置:
第一步,首先是要打开apache的相关功能。
sudo a2enmod rewrite #打开 url 重写 sudo a2enmod proxy sudo a2enmod proxy_http sudo a2enmod proxy_balancer
第二步,设置网站的配置文件,在 /etc/apache2/sites-available/ 目录下 新建文件 a.com, 写入如下内容
第三步,在/etc/apache2/sites-enabled/目录下把刚才建的文件做个软链接过来
第四步,执行、启用这个站点
或者直接重启apache服务
这样所有来自 a.com 的请求都会转发到 http://192.168.0.10, 祝你好运!
The text was updated successfully, but these errors were encountered: