nginx 配置详解

2024-11-02 08:58:57

1、【nginx.conf基本组成】:xxxxxevents{xxxxx}http{xxxxxserver{xxxxx}server{xxxxx}xxxxx}

nginx 配置详解nginx 配置详解

3、【events部分】:worker_connections是每个工作进程允许最大的同时连接数 量。

nginx 配置详解

5、【nginx虚拟主机】:server{listen端口;server_name192.168.1.166;......}server_name可以是ip地址也可以是域名,可以添加多个用空格分开。

nginx 配置详解

7、【压缩输出】:gzip压缩后变为原来的<=30%配置:gzipon;gzip_min_length1k;gzip_buffers416k;gzip_http_version1.1;gzip_comp_level2;gzip_typestext/plainapplication/x-javascripttext/cssapplication/xml;gzip_varyon;

nginx 配置详解

9、【浏览器本地缓存】:expires[time|epoch|max|off]time时间值负数不缓存epoch设定为1january,1970,00:00:01GMTmax设定为31December203723:59:59GMT

10、【php fastcgi】:location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; include fastcgi_params; }

nginx 配置详解
猜你喜欢