当前位置: 首页 > news >正文

麻城做网站asp网站建设报告书

麻城做网站,asp网站建设报告书,软件开发是吃青春饭的吗,佛山网站优化质量好Nginx常用命令 配置文件常用命令启动和重启 Nginx配置文件maineventshttp常用命令 安装完成nginx后,输入 nginx -?查询nginx命令行参数 nginx version: nginx/1.22.1 Usage: nginx [-?hvVtTq] [-s signal] [-p prefix][-e filename] [-c filename] [-…

Nginx常用命令 配置文件

  • 常用命令
    • 启动和重启 Nginx
  • 配置文件
    • main
    • events
    • http

常用命令

安装完成nginx后,输入 nginx -?查询nginx命令行参数

nginx version: nginx/1.22.1
Usage: nginx [-?hvVtTq] [-s signal] [-p prefix][-e filename] [-c filename] [-g directives]Options:-?,-h         : this help-v            : show version and exit-V            : show version and configure options then exit-t            : test configuration and exit-T            : test configuration, dump it and exit-q            : suppress non-error messages during configuration testing-s signal     : send signal to a master process: stop— 快速关机, quit— 优雅地关闭, reopen— 重新打开日志文件, reload— 重新加载配置, 使用新配置启动新的工作进程, 正常关闭旧的工作进程。-p prefix     : set prefix path (default: /usr/share/nginx/)-e filename   : set error log file (default: /var/log/nginx/error.log)-c filename   : set configuration file (default: /etc/nginx/nginx.conf)-g directives : set global directives out of configuration file

启动和重启 Nginx

启动

sudo systemctl start nginx

系统启动时自启动nginx服务

sudo systemctl enable nginx

重启nginx
重启选项是停止然后启动 Nginx 服务器的快速操作。

 sudo systemctl restart nginx

重新加载配置, 使用新配置启动新的工作进程, 正常关闭旧的工作进程

nginx -s reload

快速关机

nginx -s stop

优雅地关闭

nginx -s quit

配置文件

Nginx主配置文件在 /etc/nginx/nginx.conf
在这里插入图片描述
整个配置文件有指令控制的模块组成,指令分为简单指令和快指令。一个见得指令由名称和空格分隔的参数组成并以分号";“结尾。块指令具有与简单指令相同的结构,但是它是以一组大括号”{}"包围。当然快指令中还可以有其他指令和块指令。

配置文件中可以分为四类层:main层、events层、http层、server层、location层

在这里插入图片描述

main

main层 :主要会设置一些影响 nginx 服务器整体运行的配置指令,主要包括配置运行 Nginx 服务器的用户(组)、允许生成的 worker process 数,进程 PID 存放路径、日志存放路径和类型以 及配置文件的引入等.

user nginx;              #进程用户
worker_processes auto;   #工作进程,配合和CPU个数保持一致
error_log /var/log/nginx/error.log notice;   #错误日志路径及级别
pid /run/nginx.pid;                          #Nginx服务启动的pid# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events

主要影响 Nginx 服务器与用户的网络连接,常用的设置包括是否开启对多 worker process 下的网络连接进行序列化,是否允许同时接收多个网络连接,选取哪种事件驱动模型来处理连接请求,每个 worker process 可以同时支持的最大连接数等。

events {worker_connections 1024;    #每个worker进程支持的最大连接数
}

http

Nginx 服务器配置中最频繁的部分,代理、缓存和日志定义等绝大多数功能和第三方模块的配置都在这里。server层和location层都在其中。
server也叫做虚拟主机部分,他描述一组根据不同server_name指令逻辑分割的资源,这些虚拟服务器响应http请求,最常见的配置是本虚拟机主机的监听配置和本虚拟主机的名称或 IP 配置。一个 server 块可以配置多个 location 块。location中配置匹配规则。

http {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;                                           #给客户端分配连接超时时间,服务器会在这个时间过后关闭连接。types_hash_max_size 4096;include             /etc/nginx/mime.types;default_type        application/octet-stream;# Load modular configuration files from the /etc/nginx/conf.d directory.# See http://nginx.org/en/docs/ngx_core_module.html#include# for more information.include /etc/nginx/conf.d/*.conf;      #指定在当前文件中包含另一个文件的指令server {listen       80;                  #监听端口,默认80listen       [::]:80;          server_name  _;                   #提供服务的域名或主机名root         /usr/share/nginx/html;    #存放网站的路径# Load configuration files for the default server block.include /etc/nginx/default.d/*.conf;error_page 404 /404.html;location = /404.html {}error_page 500 502 503 504 /50x.html;location = /50x.html {}}
http://www.yayakq.cn/news/907916/

相关文章:

  • 做ppt用什么网站网站兼容ie7
  • 做网站的基本步骤typecho和wordpress
  • 装饰网站建设公司华强北 网站建设
  • 自适应网站m域名必须做301网络技术工程师是干嘛的
  • 单位建网站的优势网站网站开发教程
  • 郑州艾特软件 网站建设seo专业培训机构
  • 优化方案官网se 网站优化
  • 免费推广企业网站宣城网站推广
  • 舒兰市城乡建设局网站柳江企业网站建设公司
  • 中粮网站是哪个公司做的美容院装修
  • 湖南网站建设公司 搜搜磐石网络网页制作与网站建设宝典扫描版pdf
  • 个人网站创建与管理wordpress mp3 缓存
  • 临西网站建设投资做网站
  • 农产品网站开发背景常用网站字体
  • 如何在网上推广信用卡seo快速排名优化公司
  • 做外贸soho 需要有网站吗网站建设与推广的实训报告
  • 网站建设管理报告有做的小说网站
  • 网站做不做双解析网站域名注册证书是什么
  • 广州网站建设服务网站ip和pv
  • wap网站方案网站的规划与建设案例分析
  • 最新仿5173游戏装备交易网站 游戏币交易平台源码整合支付接口网站建设a云世家宋南南
  • 辽宁网站优化上海市装修公司
  • 北京网站空间域名精湛的企业网站建设
  • 织梦cms网站搬家网站建设公司销售技巧
  • 网站开发工程师累不累昆明网站制作费用
  • 展示型网站可以做推广的吗做网站需要看啥书
  • 建设银行网站会员登陆佛山网站建设费用
  • 网站建设的含盖哪方面提交网站到百度
  • 200m的空间可以做大大的网站一个服务器可以建多少个网站
  • 成都网站设计公司排名网站建设购买模板