首页 > 解决方案 > Apache 无法识别域 - Spring App

问题描述

当我只输入域时,它会将我重定向到https://example.net,这很好,但我收到此错误:
页面未正确重定向
我在 error.log 中没有任何错误:(

这是来自 000-default.conf 的代码:

<VirtualHost *:80>
    ProxyPreserveHost On
    ProxyPass / http://127.0.0.1:8080/
    ProxyPassReverse / http://127.0.0.1:8080/
    Redirect permanent / https://example.net/
    ServerName www.example.net
</VirtualHost>

Listen 443

NameVirtualHost *:443
<VirtualHost *:443>
    SSLEngine On
    SSLProxyEngine On
    SSLCertificateKeyFile /etc/apache2/ssl/file1.key
    SSLCertificateChainFile /etc/apache2/ssl/file2.ca-bundle
    SSLCertificateFile /etc/apache2/ssl/file3.crt
    ProxyPreserveHost on
    RequestHeader set X-Forwarded-Proto https
    RequestHeader set X-Forwarded-Port 443
    ProxyPass / http://127.0.0.1:8080/
    ProxyPassReverse / http://127.0.0.1:8080/
    ServerName www.example.net
    ServerAlias example.net
</VirtualHost>

标签: apachelocalhost

解决方案


推荐阅读