以 CentOS 为例:
新建如下文件:
vim /etc/httpd/conf.d/proxy.conf内容如下:
<VirtualHost *:80> ServerName public.server.name ProxyRequests Off ProxyPreserveHost On <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ </VirtualHost>之后执行如下命令:
sudo /usr/sbin/setsebool -P httpd_can_network_connect 1最后重启 Apache 即可:
sudo systemctl restart httpd