phper 发表于 2015-9-18 00:02:37

lnmpa 如何实现 http 范文跳转到 https 麻烦军哥 各位大哥 给点建议

如题,军哥这个如何实现下面是 vhost下面的配置文件内容
server
      {
                listen 80;
                #listen [::]:80;
                server_name xxx.xxx.com xxx.com;
                index index.html index.htm index.php default.html default.htm default.php;
                root/home/wwwroot/xxx.xxx.com;
                keepalive_timeout   60;
                location / {
                        try_files $uri @apache;
                        }

                location @apache {
                        internal;
                        proxy_pass http://127.0.0.1:88;
                        include proxy.conf;
                        }

                location ~ [^/].php(/|$)
                        {
                              proxy_pass http://127.0.0.1:88;
                              include proxy.conf;
                        }
                location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
                {
                  expires      30d;
                }

                location ~ .*.(js|css)?$
                {
                  expires      12h;
                }

                access_log/home/wwwlogs/xxx.xxx.com.logaccess;

      }

server
{
listen      443;
server_name xxx.xxx.com xxx.com;
index index.html index.htm index.php default.html default.htm default.php;
root/home/wwwroot/xxx.xxx.com;

ssl on;
ssl_certificate /home/xxx.xxx.com.crt;
ssl_certificate_key /home/xxx.xxx.com.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

location ~ [^/].php(/|$)
                        {
                              proxy_pass http://127.0.0.1:88;
                              include proxy.conf;
                        }
access_logoff;
}
该如何修改 实现 http 跳转到 https ? 麻烦军哥给点建议 谢谢

[ 本帖最后由 phper 于 2015-9-18 16:32 编辑 ]

licess 发表于 2015-9-18 09:56:02

参考 nginx的301就行 http://lnmp.org/faq/lnmp-nginx-301-rewrite.html

phper 发表于 2015-9-18 16:31:46

回复 2# 的帖子

谢谢 军哥 我去试试
页: [1]
查看完整版本: lnmpa 如何实现 http 范文跳转到 https 麻烦军哥 各位大哥 给点建议