user group www www;

worker_processes  8;//进程数,建议设置为等于CPU总核心数

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  65;

gzip  on;

server {

listen       80;

server_name  localhost;

#charset koi8-r;

access_log  logs/host.access.log  main;

#站点文件目录

location / {

root   /app/website;

index  index.html index.htm index.php;

}

#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_param  SCRIPT_FILENAME  /app/website$fastcgi_script_name;

include        /app/nginx/conf/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;

#    server_name  localhost;

#    ssl                  on;

#    ssl_certificate      cert.pem;

#    ssl_certificate_key  cert.key;

#    ssl_session_timeout  5m;

#    ssl_protocols  SSLv2 SSLv3 TLSv1;

#    ssl_ciphers  HIGH:!aNULL:!MD5;

#    ssl_prefer_server_ciphers   on;

#    location / {

#        root   html;

#        index  index.html index.htm;

#    }

#}

}

转载于:https://blog.51cto.com/sunrain891213/1408770

【自用】nginx.conf相关推荐

  1. Nginx配置文件nginx.conf中文详解(转)

    ######Nginx配置文件nginx.conf中文详解######定义Nginx运行的用户和用户组 user www www;#nginx进程数,建议设置为等于CPU总核心数. worker_pr ...

  2. Nginx(5)-nginx.conf文件详解

    有了以上博文知识基础,我们可以看看nginx的配置文件:nginx.conf的各项参数代表神马意思了!!! 转载:http://www.nginx.cn/76.html #运行用户 user nobo ...

  3. Nginx主配置文件nginx.conf详细说明

    第3章 Nginx核心配置文件nginx.conf史上最细中文详解 3.1定义Nginx运行的用户和用户组 user nginx nginx;#改为特殊的用户和组 3.2 nginxworker进程数 ...

  4. Nginx之nginx.conf 配置文件(二)

    上一篇博客我们将 nginx 安装在 /usr/local/nginx 目录下,其默认的配置文件都放在这个目录的 conf 目录下,而主配置文件 nginx.conf 也在其中,后续对 nginx 的 ...

  5. Nginx —— 检查配置文件nginx.conf的正确性命令(-t)

    检查配置文件  nginx.conf   文件的正确性命令: 1.执行测试命令: [root@J01051386 conf]# /usr/local/nginx/conf/nginx.conf.bak ...

  6. Nginx的配置文件nginx.conf详解

    Nginx的配置文件nginx.conf配置详解如下: user nginx nginx ; Nginx用户及组:用户 组.window下不指定 worker_processes 8; 工作进程:数目 ...

  7. Nginx(二)------nginx.conf 配置文件

    上一篇博客我们将 nginx 安装在 /usr/local/nginx 目录下,其默认的配置文件都放在这个目录的 conf 目录下,而主配置文件 nginx.conf 也在其中,后续对 nginx 的 ...

  8. php fpm.conf 注释,使用sed处理php-fpm.conf和nginx.conf文本里的注释信息

    php-fpm.conf: 想自己搞一个自动修改php-fpm.conf的shell脚本.刚安装的php,默认的是nobody用户运行的,这里修改为了www,并去掉了两边的注释符 sed '63,66 ...

  9. Nginx报错:nginx: [emerg] open() “/usr/local/nginx/../conf/nginx.conf“ failed (2: No such file or direc

    [root@ubuntu /usr/local/nginx/sbin]6# ./nginx -s reload nginx: [error] open() "/usr/local/nginx ...

最新文章

  1. java servlet 路径_JavaServlet 路径书写总结
  2. php session_start() 非常慢,PHP session_start()很慢问题分析与解决办法
  3. final finally finalize 的区别
  4. 如何更改Windows 10锁屏界面超时时间
  5. Oracle start with.connect by prior子句实现递归查询
  6. 有linux服务器用来干什么用的,linux集群能干什么
  7. UML?类图中聚合和组合的区别
  8. 用MapX与C#开发地理信息系统
  9. 海康linux 密码忘记,linux下调用海康sdk
  10. 文字转语音真人发声免费的有哪些?文字转语音有这两款软件就够了
  11. PCI/PCIe接口卡Windows驱动程序(4)- 驱动程序代码(源文件)
  12. JAVA代码实现计算器功能
  13. 大带宽、高灵敏度、扫描快速手持式监测接收机TFN DC700S
  14. linux上热编译react,reactos终于被成功编译通过
  15. vue+netty+redis微信猜数对战小游戏
  16. 请教PCI卡的DMA方式问题
  17. 30岁程序员:总在错过风口,终于熬成“码畜”
  18. python32位和64位有什么区别_python32位和64位有什么区别
  19. linux文件中的^M
  20. LinuxDay12——磁盘存储和文件系统

热门文章

  1. vue 如何生成一个dom元素_vue 学习心得——DOM树如何被构建
  2. java中接口什么时候用_我什么时候应该在java中使用接口?
  3. dmx计算机,DMX是什么意思
  4. win2003 服务器超出最大连接+强制重启服务器(方法)
  5. 6 有序集合ZSet(Sorted Set)
  6. Javascript一(变量,数据类型,正则表达式,数据,语句)
  7. 乌班图14.04安装搜狗输入法
  8. [JavaScript]为JS处理二进制数据提供可能性的WEB API
  9. Linear Algebra lecture6 note
  10. 20145207 《Java程序设计》第5周学习总结