<?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>爱周末 &#187; nginx https</title>
	<atom:link href="http://zhoumo123.cn/tag/nginx-https/feed" rel="self" type="application/rss+xml" />
	<link>http://zhoumo123.cn</link>
	<description>知识分享，共同进步。zhoumo123.cn</description>
	<lastBuildDate>Thu, 07 Nov 2019 05:53:49 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0.1</generator>
	<item>
		<title>nginx 80端口重定向到443 http访问自动跳转到https</title>
		<link>http://zhoumo123.cn/nginx/2368.html</link>
		<comments>http://zhoumo123.cn/nginx/2368.html#comments</comments>
		<pubDate>Tue, 06 Jan 2015 02:54:08 +0000</pubDate>
		<dc:creator><![CDATA[zhangc]]></dc:creator>
				<category><![CDATA[nginx]]></category>
		<category><![CDATA[nginx https]]></category>

		<guid isPermaLink="false">http://zhoumo123.cn/?p=2368</guid>
		<description><![CDATA[分享nginx下http访问自动跳转到https上，即nginx 80端口重定向到443端口。配置如下： 一、按照如下格式修改nginx.conf 配置文件，80端口会自动转给443端口，这样就强制使用SSL证书加密了。访问http的时候会自动跳转到https上面。 server { listen 80; server_name www.域名.com; rewrite ^(.*) https://$server_name$1 permanent; } server { listen 443; server_name www.域名.com; root /home/www; ssl on; ssl ...  <a href="http://zhoumo123.cn/nginx/2368.html">  阅读全文 </a>]]></description>
				<content:encoded><![CDATA[<p>分享nginx下http访问自动跳转到https上，即nginx 80端口重定向到443端口。配置如下：</p>
<p>一、按照如下格式修改nginx.conf 配置文件，80端口会自动转给443端口，这样就强制使用SSL证书加密了。访问http的时候会自动跳转到https上面。</p>
<p>server {<br />
listen 80;<br />
server_name www.域名.com;<br />
rewrite ^(.*) https://$server_name$1 permanent;<br />
}<br />
server {<br />
listen 443;<br />
server_name www.域名.com;<br />
root /home/www;<br />
ssl on;<br />
ssl_certificate /etc/nginx/certs/server.crt;<br />
ssl_certificate_key /etc/nginx/certs/server.key;<br />
}</p>
<p>二、修改配置文件后，重启nginx。</p>
<p>原文：http://www.yd631.com/ssl-nginx/</p>
]]></content:encoded>
			<wfw:commentRss>http://zhoumo123.cn/nginx/2368.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nginx下https配置(Nginx配置SSL证书https)</title>
		<link>http://zhoumo123.cn/nginx/2360.html</link>
		<comments>http://zhoumo123.cn/nginx/2360.html#comments</comments>
		<pubDate>Tue, 06 Jan 2015 02:36:17 +0000</pubDate>
		<dc:creator><![CDATA[zhangc]]></dc:creator>
				<category><![CDATA[nginx]]></category>
		<category><![CDATA[nginx https]]></category>

		<guid isPermaLink="false">http://zhoumo123.cn/?p=2360</guid>
		<description><![CDATA[在nginx下如何配置部署https网站呢？给大家分享下在nginx下配置https网站的步骤。 一、ssh登陆到服务器上，终端输入以下命令，使用openssl生成RSA密钥及证书。 # 生成一个RSA密钥 $ openssl genrsa -des3 -out 33iq.key 1024 # 拷贝一个不需要输入密码的密钥文件 $ openssl rsa -in 33iq.key -out 33iq_nopass.key # 生成一个证书请求 $ openssl req -new -key 33iq.key -out 33iq.csr # 自己签发证书 $ openssl x509 -req  ...  <a href="http://zhoumo123.cn/nginx/2360.html">  阅读全文 </a>]]></description>
				<content:encoded><![CDATA[<p>在nginx下如何配置部署https网站呢？给大家分享下在nginx下配置https网站的步骤。</p>
<p><strong>一、ssh登陆到服务器上，终端输入以下命令，使用openssl生成RSA密钥及证书。</strong></p>
<p># 生成一个RSA密钥</p>
<p>$ openssl genrsa -des3 -out 33iq.key 1024</p>
<p># 拷贝一个不需要输入密码的密钥文件</p>
<p>$ openssl rsa -in 33iq.key -out 33iq_nopass.key</p>
<p># 生成一个证书请求</p>
<p>$ openssl req -new -key 33iq.key -out 33iq.csr</p>
<p># 自己签发证书</p>
<p>$ openssl x509 -req -days 365 -in 33iq.csr -signkey 33iq.key -out 33iq.crt<br />
第3个命令是生成证书请求，会提示输入省份、城市、域名信息等，重要的是，email一定要是你的域名后缀的。这样就有一个 csr 文件了，提交给 ssl 提供商的时候就是这个 csr 文件。当然我这里并没有向证书提供商申请，而是在第4步自己签发了证书。</p>
<p><a href="http://img.zhoumo123.cn/wp-content/uploads/2015/01/openssl.jpg"><img class="alignnone wp-image-2361 size-full" title="nginx下https配置(Nginx配置SSL证书部署HTTPS网站)" src="http://img.zhoumo123.cn/wp-content/uploads/2015/01/openssl.jpg" alt="nginx下https配置(Nginx配置SSL证书部署HTTPS网站)" width="570" height="568" /></a></p>
<p><strong>二、编辑配置文件nginx.conf，给站点加上HTTPS协议</strong></p>
<p>server {</p>
<p>server_name YOUR_DOMAINNAME_HERE;</p>
<p>listen 443;</p>
<p>ssl on;</p>
<p>ssl_certificate /usr/local/nginx/conf/33iq.crt;</p>
<p>ssl_certificate_key /usr/local/nginx/conf/33iq_nopass.key;</p>
<p># 若ssl_certificate_key使用33iq.key，则每次启动Nginx服务器都要求输入key的密码。</p>
<p>}<br />
重启Nginx后即可通过https访问网站了。</p>
<p>自行颁发的SSL证书能够实现加密传输功能，但浏览器并不信任，会出现以下提示：</p>
<p><a href="http://img.zhoumo123.cn/wp-content/uploads/2015/01/openssl-2.jpg"><img class="alignnone wp-image-2362 size-full" title="nginx配置ssl 安全证书" src="http://img.zhoumo123.cn/wp-content/uploads/2015/01/openssl-2.jpg" alt="nginx配置ssl 安全证书" width="481" height="289" /></a></p>
<p>原文：http://www.blogjava.net/ivanwan/archive/2012/12/11/392754.html</p>
]]></content:encoded>
			<wfw:commentRss>http://zhoumo123.cn/nginx/2360.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
