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



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

只需在 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

最新更新