VPS侦探论坛

 找回密码
 注册
查看: 3430|回复: 2

LNMP 301重定向 无限次

[复制链接]
发表于 2019-9-21 14:01:41 | 显示全部楼层 |阅读模式

server
    {
        listen 80;
        #listen [::]:80;
        server_name www.xxx.com xxx.com;
     return 301 https://www.xxx.com$request_uri;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/www.xxx.com/public;

        include rewrite/xxx.conf;
        #error_page   404   /404.html;

        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

        include enable-php-pathinfo.conf;

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

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

        location ~ /.well-known {
            allow all;
        }

        location ~ /\.
        {
            deny all;
        }
        location / {
        try_files $uri /index.php$is_args$args;
        }
        access_log  /home/wwwlogs/www.xxx.com.log;
    }

我设置了 为什么就是进不去无限次

if ($host = 'lnmp.org') {  return 301 https://www.lnmp.org$request_uri;}这段代码怎么设置 xxx.com调整 https://www.xxx.com   www.xxx.com也调整 https://www.xxx.com

美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2019-9-21 19:34:18 | 显示全部楼层


你至贴出的http虚拟主机的配置文件,没问题
https的配置文件也需要贴出来
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2019-9-22 12:00:30 | 显示全部楼层

licess 发表于 2019-9-21 19:34
你至贴出的http虚拟主机的配置文件,没问题
https的配置文件也需要贴出来

没有 HTTPS的,因为HTTPS安装失败了,不过又可以打开https
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-22 10:31 , Processed in 0.025077 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表