1.--with-http_stub_status_module nginx客户端状态

# 打开default.conf文件
vim /etc/nginx/conf.d/default.conf

# 添加 到default.conf 文件中
location /mystatus {
        stub_status;
}

# 检查配置是否正确
nginx -tc /etc/nginx/nginx.conf

# 重载配置文件
nginx -s reload -c /etc/nginx/nginx.conf

2. --with-http_random_index_module 目录中随机选择一个主页 

# 打开default.conf文件
vim /etc/nginx/conf.d/default.conf

# 添加 到default.conf 文件中
location /(所有路径) {
        root   /usr/share/nginx/html;    # 首页页面的路径
        random_index on;  (随机选择一个主页)
        # index  index.html index.htm;    # 首页访问的那个页面
    }

# 检查配置是否正确
nginx -tc /etc/nginx/nginx.conf

# 重载配置文件
nginx -s reload -c /etc/nginx/nginx.conf

3.--with-http_sub_module  http内容替换

# 打开default.conf文件
vim /etc/nginx/conf.d/default.conf

# 添加 到default.conf 文件中
location /(所有路径) {
        root   /usr/share/nginx/html;    # 首页页面的路径
        index  index.html index.htm;    # 首页访问的那个页面
        sub_filter '<a>imoce' '<a>ccc';  # <a>imoce替换成<a>ccc
        sub_filter_onece off;  # 全部替换   默认替换第一个
    }

# 检查配置是否正确
nginx -tc /etc/nginx/nginx.conf

# 重载配置文件
nginx -s reload -c /etc/nginx/nginx.conf

  

  

 

nginx 常用的中间件的更多相关文章

  1. Nginx 常用全局变量 及Rewrite规则详解

    每次都很容易忘记Nginx的变量,下面列出来了一些常用 $remote_addr //获取客户端ip $binary_remote_addr //客户端ip(二进制) $remote_port //客 ...

  2. nginx 常用的 URL 重写方法

    转自:http://www.jbxue.com/article/4727.html Nginx中一些常用的URL 重写方法介绍,有需要的朋友可以参考下.url重写应该不陌生,不管是SEO URL 伪静 ...

  3. 3.Nginx常用功能介绍

    Nginx常用功能介绍 Nginx反向代理应用实例 反向代理(Reverse Proxy)方式是指通过代理服务器来接受Internet上的连接请求,然后将请求转发给内部网络上的服务器,并且从内部网络服 ...

  4. Nginx常用配置实例(4)

    Nginx作为一个HTTP服务器,在功能实现方面和性能方面都表现得非常卓越,完全可以与Apache相媲美,几乎可以实现Apache的所有功能,下面就介绍一些Nginx常用的配置实例,具体包含虚拟主机配 ...

  5. 【Linux】nginx常用命令

    相关内容链接 Centos之安装Nginx及注意事项 [nginx]详细配置说明 nginx常用命令 [重新加载配置]sudo nginx -s reload [打开nginx配置]sudo vim ...

  6. Nginx系列一:正向代理和反向代理、Nginx工作原理、Nginx常用命令和升级、搭建Nginx负载均衡

    转自https://www.cnblogs.com/leeSmall/p/9351343.html 仅供个人学习 一.什么是正向代理.什么是反向代理 1. 正向代理,意思是一个位于客户端和原始服务器( ...

  7. nginx常用命令及简单配置

    nginx常用命令 nginx -c /usr/local/nginx/conf/nginx.conf 启动nginx(windows下start nginx); nginx -s quit 停止ng ...

  8. Nginx常用功能

    3.Nginx常用功能 3.1 反向代理服务器 3.1.1.demo2 a.我在tomcat下部署了一个javaweb项目,tomcat安装的服务器IP为:192.168.37.136,部署的项目在t ...

  9. 【第六课】Nginx常用配置下详解

    目录 Nginx常用配置下详解 1.Nginx虚拟主机 2.部署wordpress开源博客 3.部署discuz开源论坛 4.域名重定向 5.Nginx用户认证 6.Nginx访问日志配置 7.Ngi ...

随机推荐

  1. [LeetCode] 402. Remove K Digits 去掉K位数字

    Given a non-negative integer num represented as a string, remove k digits from the number so that th ...

  2. SpringBootThymeleaf案例

    一.添加依赖 <!-- 添加thymeleaf模版的依赖 --> <dependency> <groupId>org.springframework.boot< ...

  3. 基于sign的pose-graph残差函数构建

    沿sign的法线方向优化车辆位姿,优化目标函数也即残差函数构建过程如下:

  4. guava(二) Equivalence & Supplier

    一.Equivalence 一种判定两个实例是否相等的策略 全路径: com.google.common.base 声明: @GwtCompatible public abstract class E ...

  5. PurpleAir空气质量数据采集

    PurpleAir空气质量数据采集 # -*- coding: utf-8 -*- import time, datetime, calendar import urllib, requests im ...

  6. session的工作原理与session用法

    一直在使用session存储数据,一直没有好好总结一下session的使用方式以及其工作原理,今天在这里做一下梳理. 这里的介绍主要是基于php语言,其他的语言操作可能会有差别,但基本的原理不变. 1 ...

  7. C# Newtonsoft.Json.JsonReaderException:“Could not convert string to decimal:

    使用Newtonsoft.Json,报以上错误,问题的原因是有"",把“”替换成null: 以前的json: [{"WengvNj":"df5c38c ...

  8. C#通过字符串分割字符串Split

    string[] strArr = str.Split(new[] {"****==="},StringSplitOptions.None); 更多内容关注公众号 洛水梅家

  9. SqlDbx连接oracle(无需安装Oracle客户端)

    下载地址:https://download.csdn.net/download/xzplinke/10428957 解压SqlDbx.zip,将SqlDbx放到C:盘根目录(C:\SqlDbx 路径是 ...

  10. 字节输出流FileOutputStream

    #字节流 字节输出流FileOutputStream 创建输出流对象 OutputStream 流对象是一个抽象类,不能实例化.所以,我们要找一个具体的子类 :FileOutputStream. 查看 ...