<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>nginx.conf on 明哥技术笔记</title>
    <link>http://test.mylass.com/tags/nginx.conf/</link>
    <description>Recent content in nginx.conf on 明哥技术笔记</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <copyright>明哥技术笔记</copyright>
    <lastBuildDate>Sun, 09 Dec 2018 00:00:00 +0000</lastBuildDate><atom:link href="http://test.mylass.com/tags/nginx.conf/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>nginx站点配置</title>
      <link>http://test.mylass.com/linux/nginx/</link>
      <pubDate>Sun, 09 Dec 2018 00:00:00 +0000</pubDate>
      
      <guid>http://test.mylass.com/linux/nginx/</guid>
      <description>
        
          
            使用 docker 容器，使用 docker-compose 管理
compose 目录 /root/nginx-container
nginx 配置文件：
1/root/nginx-container/conf/nginx.conf 2/root/nginx-container/conf.d/*.conf SSL 证书存放路径，在此目录再以项目或站点名称创建文件夹存放
1/root/nginx-container/ssl/ 目前 sxsc 站点的配置文件 /root/nginx-container/conf/conf.d/sxsc.ltd.conf ， SSL 证书存放路径 /root/nginx-container/ssl/sxsc.ltd/ .
添加新站点 在 /root/nginx-container/conf/conf.d/ 目录下创建一个新文件，并以 .conf 结尾， 可以用站点名称命名，如：www.sxsc.com.conf, 配置文件内容，可参考以下
1server { 2 listen 80; # 监听端口 3 server_name sxsc.ltd www.sxsc.ltd; # 域名、主机名 4 # 以下是 http 跳转到 https，并返回 HTTP 301 永久重写向. 5 # 适合开启了https的站点，若用户从https访问则自动跳转到https 6 location / { 7 rewrite ^/(.*)$ https://www.sxsc.ltd/$1 permanent; 8 } 9} 10server { 11 listen 443 ssl; # 监听端口，并开启 SSL 12 server_name sxsc.
          
          
        
      </description>
    </item>
    
  </channel>
</rss>
