Articles of https

_default_ VirtualHost在端口443上重叠,第一个优先

我有两个Ruby on Rails 3应用程序运行在相同的服务器,(Ubuntu 10.04),都与SSL。 这是我的apacheconfiguration文件: <VirtualHost *:80> ServerName example1.com DocumentRoot /home/me/example1/production/current/public </VirtualHost> <VirtualHost *:443> ServerName example1.com DocumentRoot /home/me/example1/production/current/public SSLEngine on SSLCertificateFile /home/me/example1/production/shared/example1.crt SSLCertificateKeyFile /home/me/example1/production/shared/example1.key SSLCertificateChainFile /home/me/example1/production/shared/gd_bundle.crt SSLProtocol -all +TLSv1 +SSLv3 SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM </VirtualHost> <VirtualHost *:80> ServerName example2.com DocumentRoot /home/me/example2/production/current/public </VirtualHost> <VirtualHost *:443> ServerName example2.com DocumentRoot /home/me/example2/production/current/public SSLEngine on SSLCertificateFile /home/me/example2/production/shared/iwanto.crt SSLCertificateKeyFile /home/me/example2/production/shared/iwanto.key SSLCertificateChainFile /home/me/example2/production/shared/gd_bundle.crt […]

nginx HTTPS与HTTPconfiguration相同

有没有办法跨两个nginx server {}块共享configuration指令? 我想避免重复规则,因为我的网站的HTTPS和HTTP内容都是以完全相同的configuration提供的。 目前,这是这样的: server { listen 80; … } server { listen 443; ssl on; # etc. … } 我可以做些什么: server { listen 80, 443; … if(port == 443) { ssl on; #etc } }

把httpredirect到https是不好的?

我刚刚在我的服务器上安装了SSL证书。 然后,在端口80上为我的域上的所有stream量设置redirect,将其redirect到端口443。 换句话说,我所有的http://example.comstream量现在都被redirect到相应的https://example.com版本。 redirect在我的Apache虚拟主机文件中完成,像这样… RewriteEngine on ReWriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L] 我的问题是,使用SSL有什么缺点吗? 由于这不是一个301redirect,我会通过切换到https失去search引擎链接果汁/排名吗? 我感谢帮助。 我一直想在服务器上设置SSL,只是为了做这个练习,最后我决定今晚做。 到目前为止,它似乎工作得很好,但是我不确定在每个页面上使用它是个好主意。 我的网站不是电子商务,不处理敏感数据; 它主要是为了学习而安装它的外观和快感。 更新的问题 奇怪的Bing从我的网站创build这个截图,现在它在任何地方使用HTTPS …

在Nginx中,如何在维护子域的同时将所有http请求重写为https?

我想重写我的web服务器上的所有http请求是https请求,我开始以下内容: 服务器{ 听80; 位置 / { 重写^(。*)https://mysite.com$1永久; } … 一个问题是,这剥离了任何子域信息(例如,node1.mysite.com/folder),我怎么能重写上述重新路由到https和维护子域?