Blogger Information
Blog 11
fans 0
comment 0
visits 8050
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
nginx的配置文件详解(一)
四火同学的博客
Original
1110 people have browsed it

今天是2017年10月8日,国庆长假的最后一天。今年的国庆长假难得有第八天,好不容易将布尔教育的linux篇看完。现在进入nginx详解篇,跟着十八哥的步伐开始学习nginx。首先进入nginx.conf配置篇:

        在nginx.conf中的worker_processes是nginx的工作进程。在考虑优化时,worker_processes=CPU数量*核数。不能盲目的设置。events一般是配置1个worker能同时允许多少个连接,默认是1024个,一个子进程最大允许连接1024个连接。

虚拟主机的配置:主要是在server部分配置

server{
    listen 80;
    server_name ddd.com;
    location /{
    root html/ddd;
    index index.php index.html;
    }
    location ~ \.php${
      root html/ddd;
      fastcgi_pass 127.0.01:9000;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAMR $DOCUMENT_ROOT$fastcgi_script_name;
      include fastcgi_param;
      }
    
}

更新完配置后

./sbin/nginx -s reload

然后需要在本地主机配置DNS服务器:C:\Windows\System32\drivers\etc\HOSTS。

在HOSTS文件中添加192.168.83.132     ddd.com

配置形式同apache服务器一致。

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!