APACHE2HTTPS重定向工作,但HTTP重定向到本地IP地址

问题描述 投票:0回答:1
我的Apache2 Web服务器运行良好,今天我为其他服务(Jeelyfin作为典范)添加了子域reddirect。

jellyfin reddirection fonction非常好,jellyfin在另一个IP地址上在端口8096上工作,当我键入jelly.mydomain.fr时,它重定向良好

next我有一个我想重定向的proxmox实例,要在本地访问它,我必须键入https:// ipaddress:8006(这里没有新事物)。现在,我已将端口80和443的Proxmox.mydomain.conf文件设置为https:// ipaddress:8006 现在,当我键入

https://proxmox.mydomain.fr

时,它运行良好,但是当我执行proxmox.mydomain.fr时,它会将我重新启动到本地IP地址,显然在同一网络上不在同一网络上时无法正常工作。 proxmox.mydomain.fr.conf:

#<VirtualHost *:80> # ServerName proxmox.mydomain.fr # # Rediriger toutes les requêtes HTTP vers l'URL HTTPS externe # RewriteEngine On # RewriteRule ^(.*)$ https://IpAddress:8006$1 [L,R=301] # ErrorLog ${APACHE_LOG_DIR}/proxmox.mydomain.fr-error.log # CustomLog ${APACHE_LOG_DIR}/proxmox.mydomain.fr-access.log combined #</VirtualHost> <VirtualHost *:80> ServerName proxmox.mydomain.fr ServerAlias www.proxmox.mydomain.fr # Rediriger toutes les requêtes HTTP vers HTTPS sur le même domaine Redirect permanent / https://proxmox.mydomain.fr/ ErrorLog ${APACHE_LOG_DIR}/proxmox.mydomain.fr-error.log CustomLog ${APACHE_LOG_DIR}/proxmox.mydomain.fr-access.log combined </VirtualHost>

我已经尝试使用注释的文本来重定向使用RewriteEngine指令,但没有与域名和IP地址一起使用。

proxmox.mydomain.fr-ssl.conf:
<VirtualHost *:443>
    ServerName proxmox.mydomain.fr
    ServerAlias www.proxmox.mydomain.fr

    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/proxmox.mydomain.fr/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/proxmox.mydomain.fr/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf

    SSLProxyEngine On
    SSLProxyVerify none
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    SSLProxyCheckPeerExpire off

    ProxyPreserveHost On
    ProxyPass / https://IpAddress:8006/
    ProxyPassReverse / https://IpAddress:8006/

    ErrorLog ${APACHE_LOG_DIR}/proxmox.mydomain.fr-error.log
    CustomLog ${APACHE_LOG_DIR}/proxmox.mydomain.fr-access.log combined
</VirtualHost>

我尝试使用RewriteEngine和重定向指令,使用域名或IP地址,但似乎没有任何作用

动作的目标是仅通过键入proxmox.mydomain.fr访问https ressource,它适用于我的其他一些服务(在http)中仅用于proxmox,仅在键入https时,它可以正常工作,我跳了一下,我跳了http,我可以重新指向http请求域名,而不是IP地址

我没有找到有关此问题的任何主题,也许我不知道如何搜索

对于我的裸眼,我在配置中看不到任何错误,也许您应该确保重新加载Apache配置(

service apache2 reload

或类似命令)

apache web apache2
1个回答
0
投票


最新问题
© www.soinside.com 2019 - 2025. All rights reserved.