官网:http://nginx.org

1,下载安装包并解压到目录,然后,在cmd中执行下列操作(双击应该也行):

cd nginx

start nginx

这样,nginx 服务就启动了。打开任务管理器,查看 nginx.exe 进程,有二个进程会显示,占用系统资源,那是相当的少。然后再打开浏览器,输入 http://127.0.0.1/  就可以看到nginx的欢迎页面了

nginx -s stop          // 停止nginx
nginx -s reload       // 重新加载配置文件
nginx -s quit          // 退出nginx

2,配置文件nginx/conf/nginx.conf

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

#gzip  on;

server {
        listen       80;
        server_name  localhost;

#charset koi8-r;

#access_log  logs/host.access.log  main;

location / {
            root   html;
            index  index.html index.htm;
        }

#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  /scripts$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;
    #    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://www.cnblogs.com/only2/archive/2013/04/15/3022226.html

window7下nginx配置文件详解相关推荐

  1. 配置nginx方向代理,实现URL隐形转发 (附带nginx配置文件详解)

    配置nginx方向代理,实现URL隐形转发 (附带nginx配置文件详解) 免费领取满减阿里云红包 项目名称:[域名解析–隐形URL转发]–centos 7.3 环境: 阿里云服务器之上有多个tomc ...

  2. nginx学习简介-安装-启动-命令-nginx配置文件详解

    nginx是什么:nginx是一个高性能的HTTP和反向代理web服务器.同时也提供了IMAP/POP3/SMTP服务. nginx特点:开源.占内存少.轻量级.高性能(有报告表面nginx能支持高达 ...

  3. nginx 配置文件详解

    nginx 配置文件分为三部分: 一.全局块:从配置文件开始到events块之间的内容,主要会配置一些影响nginx服务器整体运行的配置指令,主要包括配置运行nginx服务器的用户(组).允许生成的w ...

  4. Nginx 配置文件详解(一)

    文章目录 Nginx 配置文件内容 Nginx 配置文件基本结构 Nginx 配置文件详细信息 全局块配置 配置运行 Nginx 服务器用户(组) 配置 worker processes 相关 配置 ...

  5. nginx配置文件详解(三)

    nginx配置文件详细解析 nginx安装目录:  /usr/local/nginx 配置文件:  /usr/local/nginx/conf 目录下的 nginx.conf文件 nginx优化方法 ...

  6. nginx 访问图片404_Nginx学习笔记(二、Nginx配置文件详解) - 被猪附身的人

    nginx的启停控制 1.Nginx信号控制: nginx中可以通过发送信号的方式来控制服务器的启停等,但要达成这些操作首先要知道nginx的PID. 获取pid的方式有两种: 利用linux的ps命 ...

  7. linux下ftp配置文件详解

    # 匿名用户配置 anonymous_enable=YES # 是否允许匿名ftp,如否则选择NO anon_upload_enable=YES # 匿名用户是否能上传 anon_mkdir_writ ...

  8. nginx 配置文件详解 深入理解nginx配置文件

    #运行用户 user wenji; #启动进程,通常设置成和cpu的数量相等 worker_processes  8; #全局错误日志及PID文件 error_log  /var/log/nginx/ ...

  9. Nginx配置文件详解说明

    #启动子进程程序默认用户 #user nobody; #一个主进程和多个工作进程.工作进程是单进程的,且不需要特殊授权即可运行:这里定义的是工作进程数量 worker_processes 1;#全局错 ...

最新文章

  1. 2022-2028年中国木制拼板玩具市场调查研究报告
  2. pycharm python 如何快速给代码块添加try/catch try/finally包裹?【ctrl+alt+T】
  3. python——学习笔记1
  4. 分库分表的事务处理机制
  5. STM32——流水灯
  6. input输入数字验证
  7. android手势监听功能吗,Android手势监听 OnGestureListener (短按,长按,慢滑动,快滑动)...
  8. 逻辑OR(||)妙用
  9. 凌晨一点的粤海街道对抗来自美国的力量|湾区人工智能
  10. 查看及修改当前数据库的所支持的数据库引擎以及默认数据库引擎
  11. GCC vector 叠加示例
  12. [转]什么是UAT测试?
  13. 谷粒商城:秒杀系统设计与编写
  14. IDEA MyEclipse Eclipse 快捷键大全(最终版)
  15. 高通平台提高核电电压
  16. 蓝鲸作业平台:搞定与脚本相关的一切
  17. 55、如何制作API
  18. 图解在EXCEL中,通过身份证自动获得出生日期和性别。
  19. Go语言中的字符串特性
  20. Testin云测产品更新:Bugout支持快速分享功能,高效批量分享问题

热门文章

  1. 基于zookeeper实现的分布式锁
  2. TestNG 使 Java 单元测试轻而易举
  3. svg图片在vue脚手架vue-cli怎么使用
  4. vue计算属性的缓存和方法调用的有什么区别?
  5. eclipse无法添加Tomcat7
  6. BZOJ1146 [CTSC2008]网络管理Network 树链剖分 主席树 树状数组
  7. Sublime Text3怎样在Deepin中配置CTags插件
  8. Ulua_toLua_基本案例(八)_LuaAccessingArray
  9. GridCtrl学习笔记(2)寻找自动更新表格的最新数据并把其显示到当前窗口的方法...
  10. 构造函数、拷贝构造函数和析构函数的的调用时刻及调用顺序