<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>443端口相关文章列表 | 皇家元林</title>
	<atom:link href="https://hjyl.org/tags/443%E7%AB%AF%E5%8F%A3/feed/" rel="self" type="application/rss+xml" />
	<link>https://hjyl.org</link>
	<description>刘元林的个人博客</description>
	<lastBuildDate>Sat, 20 Apr 2013 13:18:31 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://img.hjyl.org/uploads/2019/10/cropped-about-me-32x32.png</url>
	<title>443端口相关文章列表 | 皇家元林</title>
	<link>https://hjyl.org</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>给http加上s</title>
		<link>https://hjyl.org/add-s-to-http/</link>
					<comments>https://hjyl.org/add-s-to-http/#comments</comments>
		
		<dc:creator><![CDATA[皇家元林]]></dc:creator>
		<pubDate>Sat, 20 Apr 2013 13:18:31 +0000</pubDate>
				<category><![CDATA[生活点滴]]></category>
		<category><![CDATA[443端口]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[LNMP]]></category>
		<category><![CDATA[SSL证书]]></category>
		<category><![CDATA[StartSSL]]></category>
		<category><![CDATA[vps]]></category>
		<category><![CDATA[免费SSL证书]]></category>
		<category><![CDATA[网站加密]]></category>
		<guid isPermaLink="false">http://hjyl.org/?p=2461</guid>

					<description><![CDATA[申请StartSSL免费的SSL证书，并记录在lnmp+debian下的具体用法。]]></description>
										<content:encoded><![CDATA[<p>记得刚毕业，在无锡工作的时候，发现这个国度还有GFW，从那时起对https特别喜欢，传说这样就不会被GFW和谐了。因此曾一度想尽设法给自己的网站申请SSL证书。但是因为技术和money有限，搁置了。很庆幸，到目前为止，我还是很低调的。</p>
<p>用vps很长一段时间了，昨晚突然兴起，添加个https玩玩。大家可以通过<a title="皇家元林" href="http://hjyl.org" target="_blank">http://hjyl.org</a>访问本博客。有啥好处呢？不知道。因为这个是StartSSL免费的SSL证书，可能有局限性，不像<a href="https://hjyl.org/go/aHR0cHM6Ly93d3cuYWxpcGF5LmNvbS8=" rel="nofollow" target="_blank">https://www.alipay.com/</a>那样真正实现完全加密，而且在浏览器上有个锁的标识，非常有个性，看图，godaddy的更明显。</p>
<p><a href="https://img.hjyl.org/uploads/2013/04/alipay.png"><img fetchpriority="high" decoding="async" class="alignnone size-medium wp-image-2462" alt="alipay" src="https://img.hjyl.org/uploads/2013/04/alipay-300x197.png" width="300" height="197" title="alipay 300x197.png" /></a> <a href="https://img.hjyl.org/uploads/2013/04/godaddy.png"><img decoding="async" class="alignnone size-medium wp-image-2463" alt="godaddy" src="https://img.hjyl.org/uploads/2013/04/godaddy-300x219.png" width="300" height="219" title="godaddy 300x219.png" /></a></p>
<p>查了很多信息，网上关于StartSSL免费SSL证书的申请和续期教程很多。这里只记录下在lnmp+debian下的具体用法吧。</p>
<p><del>把ssl.key和ssl.crt放在/usr/local/nginx/conf/vhost下</del>（这个路径问题见下面更新），然后修改你的域名.conf，即nginx配置，主要是添加一个server，和默认的server差不多，不同的是端口，我才发现https用的是443端口，就等于说把原来的hjyl.org:80改成hjyl.org:443，只是默认80端口不需要表示出来。</p>
<div class="source" style="font-family: '[object HTMLOptionElement]','Consolas','Lucida Console','Courier New'; color: #000000;">server<br />
{<br />
listen       <span style="color: #0000ff;">80</span>;<br />
server_name hjyl.org www.hjyl.org;<br />
index index.html index.htm index.php <span style="color: #000000;">default</span>.html <span style="color: #000000;">default</span>.htm <span style="color: #000000;">default</span>.php;<br />
root  /home/wwwroot/hjyl.org;include wordpress.conf;<br />
location ~ .*.(php|php5)?$<br />
{<br />
try_files $uri =404;<br />
fastcgi_pass  unix:/tmp/php-cgi.sock;<br />
fastcgi_index index.php;<br />
include fcgi.conf;<br />
}..........<br />
}server<br />
{<br />
listen         <span style="color: #0000ff;">443</span>;<br />
server_name hjyl.org www.hjyl.org;<br />
index index.html index.htm index.php <span style="color: #000000;">default</span>.html <span style="color: #000000;">default</span>.htm <span style="color: #000000;">default</span>.php;<br />
root  /home/wwwroot/hjyl.org;</p>
<p>ssl <span style="color: #000000;">on</span>;<br />
ssl_certificate ssl.crt;       <span style="color: #008800; font-style: italic;">#如果证书和此配置文件不在同一目录，需写上路径，例如/home/wwwroot/ssl.crt</span><br />
ssl_certificate_key ssl.key;   <span style="color: #008800; font-style: italic;">#同上</span><br />
ssl_session_timeout 5m;</p>
<p>ssl_protocols SSLv2 SSLv3 TLSv1;<br />
ssl_ciphers <span style="color: #000000;">ALL</span>:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;<br />
ssl_prefer_server_ciphers   <span style="color: #000000;">on</span>;</p>
<p>include wordpress.conf;<br />
location ~ .*.(php|php5)?$<br />
{<br />
try_files $uri =404;<br />
fastcgi_pass  unix:/tmp/php-cgi.sock;<br />
fastcgi_index index.php;<br />
include fcgi.conf;<br />
fastcgi_param HTTPS <span style="color: #000000;">on</span>;   <span style="color: #008800; font-style: italic;">#添加这个，是为了在https时，点开的链接也https。</span><br />
}</p>
<p>.........<br />
}</p>
</div>
<p>然后/root/lnmp reload，看看效果吧！</p>
<p>测试过IE，chrome，和火狐，就火狐效果好点。chrome好像不支持，郁闷！不管怎样，以前想做没做到的事现在实现了，就这样低调的酷吧！并且继续折腾吧，希望会实现那理想的效果！『如找到更好的技巧，会同时在此页更新的』</p>
<p><span style="color: #ff0000;"><strong>2013/04/22  更新：</strong></span></p>
<p>几经波折，绞尽脑汁，终于弄明白了lnmp下的SSL一些问题。（在此特别感谢<a href="https://hjyl.org/go/aHR0cHM6Ly9yaXZzZW4ucnMtd29yay5tZS8=" rel="nofollow" target="_blank">Rvsien</a>指点）</p>
<p>ssl_certificate ssl.crt;<br />
ssl_certificate_key ssl.key;</p>
<p>此时，它调用的是/usr/local/nginx/conf/下的证书和key，所以这个配置建议还是带上证书和key的路径，例如</p>
<p>ssl_certificate /usr/local/nginx/conf/vhost/ssl.crt;<br />
ssl_certificate_key /usr/local/nginx/conf/vhost/ssl.key;</p>
<p>别小看https的更换，从SEO上讲，是一个新站的开始，等于换了一个域名。所以确认换https时，我们将http 301重定向到https。只需要如此配置：</p>
<p>server<br />
{<br />
listen       80;<br />
server_name hjyl.org www.hjyl.org;<br />
rewrite ^(.*) https://$server_name$1 permanent; #http 301重定向到https规则<br />
........</p>
<p>｝</p>
<p>还有特别说明，如果firefox里地址栏不显示一个锁子的话，可能是页面使用了http的链接，或者使用了http的外网的链接资源导致的，它的意思是：页面部分加密。</p>
<div id="content-copyright"><span style="font-weight:bold;text-shadow:0 1px 0 #ddd;font-size: 13px;">版权声明: </span><span style="font-size: 13px;">本文采用 <a href="https://hjyl.org/go/aHR0cHM6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLXNhLzMuMC8=" rel="nofollow" target="_blank">BY-NC-SA</a> 协议进行授权，如无注明均为原创，转载请注明转自 <a href="https://hjyl.org">皇家元林</a><br>本文链接: <a rel="bookmark" title="给http加上s" href="https://hjyl.org/add-s-to-http/">给http加上s</a></span></div>]]></content:encoded>
					
					<wfw:commentRss>https://hjyl.org/add-s-to-http/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
	</channel>
</rss>
