IP地址请求不断被反向代理重定向

时间:2020-02-03 18:04:20

标签: apache2

我创建了一个反向代理来访问Docker容器。现在,每当我向局域网上的服务器ip请求时,我都会重定向到为docker容器设置的域。 如果我请求http://ipaddress,我会得到https://sub.domain.com 甚至更陌生的是,如果我a2dissite sub.domain.com.confsystemctl reload apache2,这种行为仍然继续

.conf用于容器反向代理

<VirtualHost *:80>
   ServerName sub.domain.com
   Redirect permanent / https://sub.domain.com/
</VirtualHost>

<VirtualHost *:443>
    SSLEngine On
    SSLCertificateFile /path/to/fullchain.pem
    SSLCertificateKeyFile /path/to/privkey.pem
    SSLProxyEngine on
    ServerName sub.domain.com
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    ProxyPass / http://localhost:4040/
    ProxyPassReverse / localhost:4040/
    RequestHeader set X-Forwarded-Proto "https"
</VirtualHost>

0 个答案:

没有答案