首页 > 系统相关 >默认nginx.conf

默认nginx.conf

时间:2023-11-16 22:11:18浏览次数:23  
标签:index log 默认 access nginx html location conf

 

user nginx;
worker_processes auto;

error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

include /etc/nginx/conf.d/*.conf;
}
server {
    listen       80;
    listen  [::]:80;
    server_name  localhost;

    #access_log  /var/log/nginx/host.access.log  main;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    root           html;
    #    fastcgi_pass   127.0.0.1:9000;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #    include        fastcgi_params;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}

 

标签:index,log,默认,access,nginx,html,location,conf
From: https://www.cnblogs.com/zhulongxu/p/17837409.html

相关文章

  • P9842 [ICPC2021 Nanjing R] Klee in Solitary Confinement
    P9842[ICPC2021NanjingR]KleeinSolitaryConfinement你说得对,但是Klee比根号可爱捏题意简述给定\(n,k\)和一个长为\(n\)的序列,你可以选择对区间\([l,r]\)的数整体加上\(k\),也可以不加。最大化众数出现次数并输出。分析直接做肯定是不好做的,考虑转换思路,考虑区......
  • 内网走nginx代理访问高德webapi2.0
    需求:客户的电脑都只能访问内,服务器可以访问外网,客户电脑使用的项目中用到了高德webapi2.0。10.200.31.45:32100是我们的web服务器。网上基本上都是对高德webapi1.4的配置方式,而web2.0有一些差别。1.前端修改高德地图的js应用如果是index.html引入,修改之前的应用:<script......
  • Ubuntu 22.04 LTS 安装最新稳定版本nginx、mysql5.7和php7.2
    Ubuntu22.04LTS安装最新稳定版本nginx、mysql5.7和php7.2全部apt-get安装,就是快,迅速。前提是需要在有网络环境的情况下哈!!操作系统版本:Ubuntu22.04LTS一、安装最新稳定版本的nginxapt-getupdate#查看默认安装的nginx版本(默认为1.18。有点老,我们安装最新稳定版本)apt......
  • nginx 日志备份
    ·1、编辑脚本backup.sh#!/bin/bash#进入备份目录cd/data/nginx/logs/#设置备份名字newAccessLog="access`date+%Y-%m-%d`.log"newErrorLog="error`date+%Y-%m-%d`.log"#拷贝日志文件,已经在配置文件设置日志文件存放在:/data/nginx/logs/下,如果没有修改日志路径的一般在:/u......
  • nginx 定时重启
    1、编写脚本nginx_restart.sh#!/bin/bashps-ef|grepnginx|grep-vgrep>/data/nginx/nginx_restart.txtfile=$(cat/data/nginx/nginx_restart.txt|grepprocess|grep-vnginx_restart|awk'{print$2}')file_num=`cat/data/nginx/nginx_restart.......
  • nginx 日志查询
    转载:https://www.jianshu.com/p/f105fb19dd0b1、根据访问IP统计UVawk'{print$1}'access.log|sort|uniq-c|wc-l2、统计访问URL统计PVawk'{print$7}'access.log|wc-l3、查询访问最频繁的URLawk'{print$7}'access.log|sort|uniq-c|sort-n-k1-r|m......
  • skywalking(二) 实现基于nginx+java服务的全链路数据收集
    实现nginx+jenkins全链路数据追踪1.部署JenkinsIP:10.0.0.941.1安装、配置jenkins#1.安装jdk11aptupdateaptinstall-yopenjdk-11-jdk#2.下载tomcatmdkir/apps&cd/appswgethttps://dlcdn.apache.org/tomcat/tomcat-8/v8.5.93/bin/apache-tomcat-8.5.93.tar.g......
  • 属性设置了configurable:false,表示该属性不可删除,删改无效,也不可再次修改其特性,但是属
    执行以下程序,下列选项中,说法正确的是()varobj={brand:'华为',price:1999};Object.defineProperty(obj,'id',{value:1})Object.defineProperty(obj,'price',{configurable:false})console.log(Object.keys(obj).length);...①for(varkinobj){con......
  • 【Azure 容器应用】在中国区Azure上创建的容器服务默认应用域名不全
    问题描述在中国区Azure上,创建ContainerApp服务,发现默认的应用程序URL只有前半段,并不是一个完整的域名。这是什么情况呢?正常的ContainerApp的URL格式为:<containerappname>.<environment>.<region>.azurecontainerapps.cn。如:mymoreappinone04.icysand-c9bc5d4e.chinanorth3.azur......
  • nginx配置kibana访问用户名和密码认证、及无认证访问配置
    在nginx上配置kibana页面访问时,默认是采用kibana的认证,一般直接安装kibana后,是没有用户名和密码认证的。如果要在负载均衡上配置反向代理和用户认证,可按以下步骤进行配置:1.安装Nginx:首先,确保已经安装了Nginx,并且可以正常访问Kibana页面。2.生成密码文件:使用htpa......