nginx default server
配合server_name _ 可以匹配所有的域名,在设置default server 可以轻松屏蔽一些非域名访问的请求。
配置如下
server {
listen 80 default_server;
server_name _ ;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
error_page 404 = /50x.html;
access_log /var/log/nginx/other.log;
}
}
关键是default_server 在设在listen 同一行。
nginx default server的更多相关文章
- Nginx httpS server配置
Nginx httpS 配置 配置同时支持http和httpS协议: server { listen ; #backlog:每个网络接口接收数据包的速率比内核处理这些包的速率快时,允许送到队列的数据包 ...
- NGINX Web Server Nginx web server
原文地址:http://nginx.com/resources/admin-guide/web-server/ NGINX Web Server Nginx web server This secti ...
- nginx检查报错:nginx: [emerg] "server" directive is not allowed here in
想检查一个配置文件是否正确,-c 指定之后发现有报错,如下: [root@op-2:~# nginx -t -c /etc/nginx/conf.d/default.conf nginx: [emer ...
- nginx多server配置记录
直接在配置文件(/etc/nginx/nginx.conf)中添加如下代码: server { listen 8080; server_name 192.168.100.174:8080; root ...
- nginx: [emerg] BIO_new_file("/etc/nginx/ssl_key/server.crt") failed (SSL: error:02001002:syste
Centos 7.5 nginx+web集群配置https报错 报错信息: [root@lb01 conf.d]# nginx -tnginx: [emerg] BIO_new_file(" ...
- 阿里云centOS7.4 nginx: [emerg] "server" directive is not allowed here in /etc/nginx/vhost/xxxxxx.conf:2
里云centOS7.4配置多个站点遇到的问题nginx: [emerg] "server" directive is not allowed here in /etc/nginx/ ...
- nginx下面server配置
haomeiv配置 log_format www.haomeiv.com '$remote_addr - $remote_user [$time_local] "$request" ...
- linux+asp.net core+nginx+sql server
Linux Disibutaion:Ubuntu 16.04.1 LTS Web Server:Nginx.Kestrel 安装.net core sudo sh -c 'echo "deb ...
- 利用raspberry pi搭建typecho笔记(一) nginx PHP server quick start
前言 因为一直对linux学习很有兴趣,就拿手头的树莓派做了实验,搭建一个简易的php服务器用来跑typecho. 但是过程却是异乎寻常的艰辛,几乎每一步能卡住得地方都卡住了.而且typecho的资料 ...
随机推荐
- vector和数组
对于之前没有接触过vector的初学者来说,经常会把vector和数组弄混,因为二者在用的时候比较像,下面就详细的来介绍一下vector和数组的区别. (1) 首先,vector类似于数组,有一段连续 ...
- bootstrop日历
https://blog.csdn.net/cuixiaobo521/article/details/77880633
- dockerfile简介及书写规则
Dockerfile 简介 Dockfile是一种被Docker程序解释的脚本, Dockerfile由一条一条的指令组成,每条指 ...
- 二进制安装MySQL及破解密码
二进制安装MySQL及破解密码 1.确保系统中有依赖的libaio 软件,如果没有: yum -y install libaio 2.解压二进制MySQL软件包 tar xf mysql-5.7.24 ...
- 【Linux题目】第六关
[定时任务规则] 1. 如果在某用户的crontab文件中有以下记录,该行中的命令多久执行一次(RHCE考试题)?( ) 30 4 * * 3 mycmd A. 每小时. B. 每周. C. 每年三月 ...
- Vs Code中炫酷写代码插件Power Mode的安装配置
扩展栏搜索 Power Mode 安装 安装后重启vs code 文件->首选项->设置 搜索setting.json,点击在setting.json中编辑 打开之后在右侧用户设置里添加以 ...
- 配置secondarynamenode主机名masters
1.配置hadoop的secondarynamenode,配置内容如下 node2 本文转自 素颜猪 51CTO博客,原文链接:http://blog.51cto.com/suyanzhu/19592 ...
- ELSE 技术周刊(2017.12.25期)
业界动态 V8 release v6.4 V8引擎发布v6.4,在速度和内存优化上又带来了一些提升.对于instanceof操作符的优化,带来了3.6x速度提升,同时使得uglify-js提高了15- ...
- CentOS安装jsoncpp
两种安装方式: 通过cmake安装 通过scons安装 cmake安装见cmake安装jsoncpp,scons安装见下文. 1. 安装scons .tar.gz export MYSCONS=/ro ...
- 2-MyBatisPlus教程(HelloWorld)
1,准备数据 DROP TABLE IF EXISTS user; CREATE TABLE user ( id ) NOT NULL COMMENT '主键ID', name ) NULL DEFA ...