当前位置: 首页 >> Nginx >> 【nginx】Windows使用nginx的常用命令 >> 正文

【nginx】Windows使用nginx的常用命令

2年前 (2022-05-08)     作者:Jiaozn     分类:Nginx     阅读次数:1430     评论(1)    

cd E:\nginx

nginx -s reload

nginx -s quit

taskkill /f /t /im nginx.exe

start nginx

nginx -v

cmd


在主配置文件nginx.conf中配置


[root@web01 ~]# cat /application/nginx/conf/nginx.conf

worker_processes  2;

worker_cpu_affinity 0101 1010;

error_log logs/error.log;

 

#配置Nginx worker进程最大打开文件数

worker_rlimit_nofile 65535;

 

user www www;

events {

    #单个进程允许的客户端最大连接数

    worker_connections  20480;

    #使用epoll模型

    use epoll;

}

http {

    include       mime.types;

    default_type  application/octet-stream;

    #sendfile        on;

    #keepalive_timeout  65;

    #访问日志配置

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '

                      '$status $body_bytes_sent "$http_referer" '

                      '"$http_user_agent" "$http_x_forwarded_for"';

 

 

    #虚拟主机

    include /application/nginx/conf/extra/www.conf;

    include /application/nginx/conf/extra/blog.conf;

    include /application/nginx/conf/extra/bbs.conf;

    include /application/nginx/conf/extra/edu.conf;

    include /application/nginx/conf/extra/phpmyadmin.conf;

    include /application/nginx/conf/extra/status.conf;

 

    #nginx优化----------------------

    #隐藏版本号

    server_tokens on;

 

    #优化服务器域名的散列表大小 

    server_names_hash_bucket_size 64;

    server_names_hash_max_size 2048;

 

    #开启高效文件传输模式

    sendfile on;

    #减少网络报文段数量

    #tcp_nopush on;

    #提高I/O性能

    tcp_nodelay on;

 

    #连接超时 时间定义 默认秒 默认65秒

    keepalive_timeout 60;

    

    #读取客户端请求头数据的超时时间 默认秒 默认60秒

    client_header_timeout 15;

    

    #读取客户端请求主体的超时时间 默认秒 默认60秒

    client_body_timeout 15;

    

    #响应客户端的超时时间 默认秒 默认60秒

    send_timeout 25;

}



proxy_connect_timeout 1800s;

proxy_read_timeout 500s;

proxy_send_timeout 500s;


除非注明,发表在“Jiaozn的博客”的文章『【nginx】Windows使用nginx的常用命令』版权归Jiaozn所有。 转载请注明出处为“本文转载于『Jiaozn的博客』原地址https://www.jiaozn.com/reed/767.html
0

评论

发表评论   

昵称*

E-mail*(建议输入,以便收到博主回复的提示邮件)

网站

分享:

支付宝

微信