首页 > 系统相关 >nginx ServerName匹配规则

nginx ServerName匹配规则

时间:2023-01-03 16:35:21浏览次数:38  
标签:index www 匹配 ServerName worker nginx html location

上配置

worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       80;
        server_name  localhost;
        location / {
            root   /www/www;
            index  index.html index.htm;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

 

标签:index,www,匹配,ServerName,worker,nginx,html,location
From: https://www.cnblogs.com/ggborn-001/p/17022604.html

相关文章

  • nginx---yum安装与编译安装
    nginx学习nginxyum安装yum源安装地址http://nginx.org/en/linux_packages.html#RHELyum源配置地址[root@centos8~]#cat>/etc/yum.repos.d/nginx.repo[nginx-s......
  • nginx 目录结构
      *_temp目录为nginx安装时产生的临时文件conf目录是配置文件存放路径,./nginx.conf是主配置文件html目录为静态页面路径logs目录存放路径,access.log是访问日志,error......
  • Ubuntu22.04 编译安装nginx
    1、下载nginx软件包 https://nginx.org/en/download.html   2、压缩包上传服务器并解压缩tarxfnginx-1.22.1.tar.gz   3、进入解压目录,编译安装root......
  • Nginx 过滤url
    1、用在if中的正则表达式,下表:  说明:~匹配!~不匹配*不区分大小写这样比较好记忆。2、测试location/{if($request_uri!~"hello"){......
  • nginx快速查看配置文件的方法
    nginx的配置放在nginx.conf文件中,一般我们可以使用以下命令查看服务器中存在的nginx.conf文件。locatenginx.conf/usr/local/etc/nginx/nginx.conf/usr/local/etc/nginx/ng......
  • nginx-clojure java 集成试用
    主要是基于java开发一个简单的扩展,学习下流程java项目pom.xml<?xmlversion="1.0"encoding="UTF-8"?><projectxmlns="http://maven.apache.org/POM/4......
  • ubuntu22.04 安装nginx
    1、使用apt-get安装nginx(得机器能联网才行)#切换到root用户#切换到root用户sudo-i#更新apt源apt-getupdate#安装nginxapt-getinstallnginx-y......
  • NGINX-文件目录浏览服务
    局域网:文件服务、目录浏览、允许跨域conf/nginx.confhttp{server{}+includeservers/*.conf;}conf/servers/source.confserver{listen84;i......
  • Centos安装Nginx
    Centos安装Nginx版本区别常用版本分为四大阵营Nginx开源版Nginxplus商业版openrestyTengine编译安装先下载Nginx开源版比如:nginx-1.22.1.tar.gz借助......
  • nginx的负载均衡如何配置
    负载均衡 nginx的负载均衡有4种模式:1)、轮询(默认) 每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器down掉,能自动剔除。 2)、weight 指定轮询几率,weight......