nginx出错:rewrite or internal redirection cycle

摘要:
原始配置:location/{rewrite^/(.*).html$/$1.html?Mode=testlast;error_page404=@nodejs;}修改后:location/{root/path/to/files;indexindex.html;#try_files$uri/index.html;if($query_string!~mode=test){rewrite^/(.*).htm

原配置:location / {

        rewrite ^/(.*).html$ /$1.html?mode=test last;
        error_page 404 = @nodejs;
}



修改后:

location / {
root /path/to/files;
index index.html;
#try_files $uri /index.html;
if ($query_string !~ mode=test) {
rewrite ^/(.*).html$ /$1.html?mode=test redirect;
}
}

免责声明:文章转载自《nginx出错:rewrite or internal redirection cycle》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇pthread实现多线程查询(转)spring读取外部配置文件下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

制作openresty的docker镜像 + nginx笔记 调试rewrite和location Nginx 学习笔记

1.Dockerfile FROM centos:7.6.1810 MAINTAINER openresty1.15.8.2 <dingxiaowei@do1.com> RUN yum install -y yum-utils && yum-config-manager --add-repo https://open...

Centos安装php php-fpm 以及 配置nginx

下载php源码包 http://www.php.net/downloads.php 安装php tar -xvf php-5.5.13.tar.bz2 cd php-5.5.13 ./configure --prefix=/usr/local/php --with-config-file-path=/etc --enable-...

命名空间(app_name)和实例命名空间(namespace)

先把官网上对应用命名空间(app_name)和实例命名空间(namespace)的解释贴上: app_name(应用命名空间)通常在app.urls模块中指定,如: app_name = "test" //应用命名空间 urlpatterns = [ path("article1/", views.test, name="url_a"), ]...

shell函数的调用执行

要想调用执行自己编写的shell文件中的函数,有如下方法: 比如,自己编写了一个test.sh文件如下, #===========test.sh: #! /bin/sh echo_line() {         echo date         echo "Wellcome to shell func!" } echo_line() {...

Mac安装PHP运行环境

先安装brew ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" nginx的安装与配置 brew install nginx 修改配置文件 sudo vim /usr/local/etc/nginx/nginx.conf #修...

linux 非root用户安装nginx

第一步:首先下载依赖包 下载地址 pcre(www.pcre.org),zlib(www.zlib.org),openssl(www.openssl.org) 第二步:上传那个nginx的安装包 下载nginx安装包,解压 [bdctool@localhost setup]$ tar  -zxvf nginx-1.12.2.tar.gz [bdctool@...