Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
(Apache)将https域重定向到https端口_Https_Apache2_Http Redirect - Fatal编程技术网

(Apache)将https域重定向到https端口

(Apache)将https域重定向到https端口,https,apache2,http-redirect,Https,Apache2,Http Redirect,我以前在apache中做过重定向,但我做的很简单,就是在apache服务器中启用重写模块,然后在下面提到的/etc/apache2/sites中添加两个.conf文件 下面的文件用于将域收到的HTTP请求重定向到特定端口 <VirtualHost *:80> ServerAdmin me@mydomain.com ServerName test.domain.com ProxyPreserveHost On # setup the proxy <Proxy *>

我以前在apache中做过重定向,但我做的很简单,就是在apache服务器中启用重写模块,然后在下面提到的/etc/apache2/sites中添加两个.conf文件

下面的文件用于将域收到的HTTP请求重定向到特定端口

<VirtualHost *:80>
ServerAdmin me@mydomain.com
ServerName test.domain.com
ProxyPreserveHost On
# setup the proxy
<Proxy *>
    Order allow,deny
    Allow from all
</Proxy>
ProxyPass / https://localhost:3235/
ProxyPassReverse / https://localhost:3235/
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteCond %{SERVER_NAME} =chat-dev.motivone.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin me@mydomain.com
ServerName test.domain.com
ProxyPreserveHost On
# setup the proxy
<Proxy *>
    Order allow,deny
    Allow from all
</Proxy>
ProxyPass / https://localhost:3235/
ProxyPassReverse / https://localhost:3235/
SSLCertificateFile /etc/letsencrypt/live/test.domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/test.domain.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

服务器管理员me@mydomain.com
ServerName test.domain.com
代理主机
#设置代理
命令允许,拒绝
通融
ProxyPass/https://localhost:3235/
ProxyPassReverse/https://localhost:3235/
重新启动发动机
重写cond%{HTTPS}=在…上
RewriteCond%{SERVER_NAME}=chat-dev.motivone.com
重写规则^https://%{SERVER_NAME}%{REQUEST_URI}[END,NE,R=permanent]
下面的文件用于将域收到的HTTPS请求重定向到特定端口

<VirtualHost *:80>
ServerAdmin me@mydomain.com
ServerName test.domain.com
ProxyPreserveHost On
# setup the proxy
<Proxy *>
    Order allow,deny
    Allow from all
</Proxy>
ProxyPass / https://localhost:3235/
ProxyPassReverse / https://localhost:3235/
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteCond %{SERVER_NAME} =chat-dev.motivone.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin me@mydomain.com
ServerName test.domain.com
ProxyPreserveHost On
# setup the proxy
<Proxy *>
    Order allow,deny
    Allow from all
</Proxy>
ProxyPass / https://localhost:3235/
ProxyPassReverse / https://localhost:3235/
SSLCertificateFile /etc/letsencrypt/live/test.domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/test.domain.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

服务器管理员me@mydomain.com
ServerName test.domain.com
代理主机
#设置代理
命令允许,拒绝
通融
ProxyPass/https://localhost:3235/
ProxyPassReverse/https://localhost:3235/
SSLCertificateFile/etc/letsencrypt/live/test.domain.com/fullchain.pem
SSLCertificateKeyFile/etc/letsencrypt/live/test.domain.com/privkey.pem
Include/etc/letsencrypt/options-ssl-apache.conf

当我运行我的服务器抛出HTTP并将代理更改为HTTP时,但当我在https上运行我的服务器并尝试重定向它时,这个过程可以正常工作。它抛出的错误就像

我不确定是什么问题,需要什么样的帮助,请提前感谢