nginx配置之禁止访问和404错误功能配置
禁止访问功能配置
nginx.conf中的http{}中的server{}的location ..{}中:
location / {
#拒绝访问,192.168.16.0网段的同学都无法访问 /24是子网掩码的意思
deny 192.168.16.0/24;
root html;
index index.html index.htm;
}
404页面
nginx.conf中的http{}中的server{}中:
#error_page 404 /404.html;
nginx配置之禁止访问和404错误功能配置的更多相关文章
- springboot打war包后部署到tomcat后访问返回404错误
springboot打war包后部署到tomcat后访问返回404错误 1.正常情况下,修改打包方式为war <packaging>war</packaging> 2.启动类继 ...
- java web 404错误页面配置
java web 404错误页面配置:注意红框的地方,在工程的web.xml文件里的最开头加入如下的内容便可,但是也有问题,针对以.action后缀名和.jsp后缀名不起作用, 因为后面配置了一些拦截 ...
- 遇到IIS7配置PHP出现403和404错误的解决办法
服务器要配置PHP,总是出现403错误.服务器是新装的,操作系统是windows server 2008 R2,装的IIS7. IIS里PHP和本地服务器对比了好几遍,都没到出错的原因,后来通过cmd ...
- Nginx 配置GeoIP2 禁止访问,并允许添加白名单过滤访问设置
配置环境:Centos 7.6 + Tengine 2.3.2 GeoIP2 下载地址:https://dev.maxmind.com/geoip/geoip2/geolite2/ 1. Nginx ...
- nginx如何设置禁止访问文件或文件夹
目标: 1. 根目录 webroot: 2. 设置目标文件 /webroot/proj/deny.txt 不能访问: 做法: 1. 设置 nginx.conf ,添加一个“location”段落: 2 ...
- 【nginx】解决nginx搭建图片服务器访问图片404
图片通过ftp服务上传到/home/ftpuser/www/images目录下后访问 http://192.168.128.128/images/xxx.jpg 还是 404 NOT FOUND ,解 ...
- nginx location rewrite 禁止访问某个目录
Location 指令,是用来为匹配的 URI 进行配置 http://www.baidu.com/test/index.php?a=1&b=ture 这里面/test/index.php ...
- node.js+express+jade系列三:404错误的配置
1:新建一个404.jade 2:在app.js后面配置如下代码 app.use(function(req, res){ res.render("404", {sta ...
- springboot项目启动,但是访问报404错误
启动类Application上加了@ComponentScan(basePackages = {})这个注解导致controller扫描不到导致的,如果加了这个注解,springboot就不会扫描Ap ...
随机推荐
- java stream中Collectors的用法
目录 简介 Collectors.toList() Collectors.toSet() Collectors.toCollection() Collectors.toMap() Collectors ...
- 徐州A
#include<bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i=a;i<=b;++i) #defi ...
- CF1092 --- Tree with Maximum Cost
CF1324 --- Maximum White Subtree 题干 You are given a tree consisting exactly of \(n\) vertices. Tree ...
- 4.pickling 和unpickling是什么?
pickling 和unpickling是什么? Pickle module accepts any Python object and converts it into a string repre ...
- Java高效开发IntelliJ IDEA 2019.1 新特性
1. 重构类.文件.符号,Action 搜索 IntelliJ IDEA(以下简称 IDEA) 中的搜索可以分为以下几类 类搜索,比如 Java,Groovy,Scala 等类文件 文件搜索,类文件之 ...
- MySQL5.7中InnoDB不可不知的新特性
讲师介绍 赖铮 Oracle InnoDB团队 Principle Software Developer 曾任达梦.Teradata高级工程师,主要负责研发数据库执行引擎和存储引擎,十年以商数据库内 ...
- cookie ,session 和localStorage的区别详解
2019独角兽企业重金招聘Python工程师标准>>> cookie ,session 和localStorage的区别详解 博客分类: js 当你在浏览网站的时候,WEB 服务器会 ...
- 地表最强的MySQL安装一键式安装,信不信你下完我就给你装好!附各种Mysql安装失败的解决办法(什么你安装失败了?快来看这个)
这里还有数据库相关的优质文章:快戳我,快戳我
- Codeforce-CodeCraft-20 (Div. 2)-C. Primitive Primes(本原多项式+数学推导)
It is Professor R's last class of his teaching career. Every time Professor R taught a class, he gav ...
- HDU 1159.Common Subsequence【动态规划DP】
Problem Description A subsequence of a given sequence is the given sequence with some elements (poss ...