如何将来自aws ec2实例(Windows Server 2012 R2)的端口80的请求重定向到Apache的端口8085?

问题描述 投票:0回答:1

我有Windows Server 2012的aws ec2实例,并且正在为PHP Web服务运行wamp服务器。我想将端口80的所有请求重定向到8085,因为我已经将apache服务器端口从80更改为8085。我们如何将来自端口80的请求重定向到8085?谁能帮我这个忙吗?

apache redirect amazon-ec2 port wampserver
1个回答
1
投票

只需在Apache配置文件/etc/httpd/conf中进行以下更改

<VirtualHost _default_:80>
DocumentRoot /var/www/html/
RewriteEngine On
RewriteRule ^.*$ http://%{HTTP_HOST}:8085%{REQUEST_URI}
</VirtualHost>

此后只需重新启动Apache服务器。

service apache2 restart
© www.soinside.com 2019 - 2024. All rights reserved.