#user  nobody;
worker_processes 1; #error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info; #pid logs/nginx.pid; events {
worker_connections 1024;
} http {
include 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 logs/access.log main; sendfile on;
#tcp_nopush on; #keepalive_timeout 0;
keepalive_timeout 650;
client_max_body_size 20m;
proxy_connect_timeout 300;
proxy_read_timeout 300;
proxy_send_timeout 300; #gzip on; server {
listen 80;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
root html;
} #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 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_read_timeout 300;
fastcgi_param SCRIPT_FILENAME $document_root$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;
#}
} # another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias; # location / {
# root html;
# index index.html index.htm;
# }
#} # HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost; # ssl_certificate cert.pem;
# ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on; # location / {
# root html;
# index index.html index.htm;
# }
#}
include vhosts/*.conf;
}
user  www www;
worker_processes 8; error_log /www/logs/error.log info;
#access_log /www/logs/nginx.access.log main;
pid /var/run/nginx.pid; worker_rlimit_nofile 51200; events {
use epoll;
worker_connections 51200;
} http {
include /etc/nginx/mime.types;
default_type application/octet-stream; log_format main '"$time_local","$remote_addr","$http_x_forwarded_for","$http_host","$request","refer:$http_referer","$http_user_agent","$status","$request_time","$upstream_response_time","$body_bytes_sent","$upstream_addr","$upstream_status","$upstream_response_time","$http_cookie_pgv_pvi","$request_body","$uid_got"'; server_names_hash_bucket_size 128;
client_header_buffer_size 128k;
large_client_header_buffers 4 128k;
client_max_body_size 100m;
client_body_buffer_size 1024k; sendfile on;
tcp_nopush on; keepalive_timeout 30;
tcp_nodelay on; fastcgi_intercept_errors on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 128k;
fastcgi_read_timeout 300;
fastcgi_buffer_size 128k;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_read_timeout 300; sendfile on;
tcp_nopush on; keepalive_timeout 30;
tcp_nodelay on; fastcgi_intercept_errors on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 128k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k; gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml image/jpeg image/gif image/png;
gzip_vary on; #server {
# listen 80;
# server_name localhost;
# location / {
# proxy_next_upstream http_502 http_504 http_404 error timeout invalid_header;
# proxy_pass http://78list.cn;
#proxy_set_header Host www.yourdomain.com;
# proxy_set_header X-Forwarded-For $remote_addr;
# } #}
#upstream 78list.cn {
# server 192.168.8.113:8080;
#} include /etc/nginx/default.conf;
include /etc/nginx/upstream/*.conf;
include /etc/nginx/conf.d/*.conf;
}
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/ user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid; # Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf; events {
worker_connections 1024;
} 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;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048; client_max_body_size 8M; 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 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html; # Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf; location / {
} error_page 404 /404.html;
location = /40x.html {
} error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
} # Settings for a TLS enabled server.
#
# server {
# listen 443 ssl http2 default_server;
# listen [::]:443 ssl http2 default_server;
# server_name _;
# root /usr/share/nginx/html;
#
# ssl_certificate "/etc/pki/nginx/server.crt";
# ssl_certificate_key "/etc/pki/nginx/private/server.key";
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 10m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
#
# # Load configuration files for the default server block.
# include /etc/nginx/default.d/*.conf;
#
# location / {
# }
#
# error_page 404 /404.html;
# location = /40x.html {
# }
#
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# }
# } }

nginx.conf几个示例的更多相关文章

  1. nginx反向代理的nginx.conf配置

    下面的配置是nginx.conf的示例 nginx反向代理 就是说把跨域的url通过本地代理的方式,变成同域的请求,如此来解决跨域问题 该配置下 通过http://localhost/html5/路径 ...

  2. JAVA 解析、编辑nginx.conf

    最近工程开发遇到一个需求:用Java去解析并编辑nginx.conf 在github上找到nginx-java-parser工具,项目地址:https://github.com/odiszapc/ng ...

  3. nginx系列 3 nginx.conf介绍(1)

    一. nginx.conf 文件结构概述 在第一篇中讲到nginx的安装,安装完后,默认的nginx服务器配置文件都存在安装目录conf中,主配置文件名为nginx.conf.下面是我linux系统安 ...

  4. nginx作为web服务以及nginx.conf详解

    Nginx系列文章:http://www.cnblogs.com/f-ck-need-u/p/7576137.html 1.nginx简介 nginx是一个优秀的web服务程序.反向代理程序.它采用非 ...

  5. 004-mac上安装以及Nginx 配置文件nginx.conf详解

    1.mac上nginx安装 安装brew:go-001-环境部署,IDEA插件 安装nginx: brew search nginx brew install nginx 当然也可以编译安装 安装完以 ...

  6. 虚拟主机ip配置,nginx.conf文件配置及日志文件切割

    今天粗略整理了一下虚拟主机配置,nginx.conf文件的配置,及日志文件的切割,记录如下: nginx虚拟主机配置:1.IP地址配置,2.绑定ip地址和虚拟主机详情:1.ip地址的配置:ifconf ...

  7. [NGINX] - 配置文件优化 - NGINX.CONF

    Nginx 本文主要针对公司的Nginx负载均衡配置进行解释,配置文件在最下方.因为公司没有使用PHP,所以NGINX里面并没有太多facgi模块相关优化    NGINX.CONF user   语 ...

  8. Nginx配置文件nginx.conf(八)

    原文链接:https://www.cnblogs.com/knowledgesea/p/5175711.html 在nginx.conf的注释符号是#. 默认的nginx.conf内容为: #user ...

  9. Nginx配置文件nginx.conf有哪些属性模块?

    worker_processes 1: # worker进程的数量 events { # 事件区块开始 worker_connections 1024: # 每个worker进程支持的最大连接数 } ...

随机推荐

  1. Ajax -- 原理及简单示例

    1. 什么是Ajax •Ajax被认为是(AsynchronousJavaScript and XML的缩写).现在,允许浏览器与服务器通信而无须刷新当前页面的技术都被叫做Ajax. 2. Ajax ...

  2. Search a 2D Matrix,在有序矩阵查找,二分查找的变形; 行有序,列有序查找。

    问题描述:矩阵每一行有序,每一行的最后一个元素小于下一行的第一个元素,查找. 算法分析:这样的矩阵其实就是一个有序序列,可以使用折半查找算法. public class SearchInSortedM ...

  3. Image合并添加文字内容

    场景:将一个头像.二维码.文字信息添加到一张背景图片中,将这些信息合成一张图片. 代码已经测试验证.代码中图片自己随意找几张测试即可. 代码: import com.sun.image.codec.j ...

  4. Android 必须知道2018年流行的框架库及开发语言,看这一篇就够了!

    导语 2017 已经悄悄的走了,2018 也已经匆匆的来了,我们在总结过去的同时,也要展望一下未来,来规划一下今年要学哪些新技术.这几年优秀Android的开源库不断推出,新技术层出不穷,需要我们不断 ...

  5. git 分支管理 (转自廖雪峰的git教程)

    在版本回退里,你已经知道,每次提交,Git都把它们串成一条时间线,这条时间线就是一个分支.截止到目前,只有一条时间线,在Git里,这个分支叫主分支,即master分支.HEAD严格来说不是指向提交,而 ...

  6. OWIN初探

    什么是 OWIN ? OWIN 的全称是 "Open Web Interface for .NET", OWIN 在 .NET Web 服务器和 .NET Web 应用之间定义了一 ...

  7. 今夜我们一起学习 Apache Shiro

    简介 Apache Shiro 是一个功能强大但又非常容易使用的 Java 安全框架,提供了认证,授权,加密以及会话管理功能.因为 Shiro 的 API 是非常容易理解的,所以使用 Shiro 你可 ...

  8. python 爬虫002-http与urllib2

    urllib2 GET https://www.oschina.net/home/login #!/usr/bin/env python # -*- coding: utf-8 -*- import ...

  9. pOJ-1061 exgcd求同余方程组

    链接 就是求(m-n)*a+b*l=y-x, 类似于求解a*x+b*y=c,r=gcd(a,b),当c%r==0时有解,用exgcd求出a*x+b*y=gcd(a,b)的解,然后x*c/gcd(a,b ...

  10. lightoj1138

    二分 #include<map> #include<set> #include<cmath> #include<queue> #include<s ...