我有一个由雅虎托管的域名。
但我正在使用自己的内部服务器来实际托管我的域和云子域。
所以在雅虎,我把所有的www.mydomain.com都转发到我的静态ip
<meta http-equiv="refresh" content="0; url=http://111.111.111.111">以及我所有的子域流量到我的静态ip:
<meta http-equiv="refresh" content="0;URL=http://111.111.111.111/cloud" />我的内部服务器是运行在Ubuntu 14.04LTS上的Apache 2.4.7。我已经创建了一个虚拟主机站点并启用了它,只要我在局域网中,它就能很好地工作。但是,当我在WAN上时,web浏览器超时,提示服务器停止工作。我想我知道问题在哪里,但我不确定如何解决它,也就是重定向到htpps -我使用的是LAN IP。使用我的静态IP或域名并不能帮助我解决这个问题。这是我为虚拟主机启用的站点:
<VirtualHost *:80>
ServerAdmin admin@myexample.com
ServerName www.myexample.com
ServerAlias myexample.com
DocumentRoot /var/www/html/example-test/
Alias / /var/www/html/example-test/
### Redirect /cloud https://www.myexample.com/cloud
Redirect /cloud https://192.168.1.122/cloud
### Redirect /cloud https://111.111.111.111/cloud
<Directory /var/www/html/example-test>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/owncloud>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/apache_http_myexample.com.error.log
</VirtualHost>
### <VirtualHost www.myexample.com:443>
<VirtualHost 192.168.1.122:443>
### <VirtualHost 111.111.111.111:443>
ServerAdmin admin@myexample.com
ServerName www.myexample.com
ServerAlias myexample.com
Alias /cloud /var/www/owncloud
DocumentRoot /var/www/owncloud/
####Configuration for SSL #####
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/examplecloud.pem
SSLCertificateKeyFile /etc/apache2/ssl/examplecloud.key
#### End of SSL Configuration ####
<Directory /var/www/owncloud>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/apache_https_cloud.myexample.com.error.log
</VirtualHost>~
任何帮助/见解都将不胜感激。
谢谢,
发布于 2016-05-07 13:18:21
试试Redirect permanent /cloud https://192.168.1.122/cloud
如果这样不起作用,请尝试更通用的解决方案,将重定向替换为:
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}
https://stackoverflow.com/questions/37056725
复制相似问题