Introduction to Basic installation and configuration methods for Nginx servers under Windows system _nginx

Source: Internet
Author: User
Tags openssl

Download Address: Http://nginx.org/download/nginx-1.2.4.zip
After downloading directly to your hard drive, mine is D:\nginx
Start Nginx

CD D:
cd nginx-1.2.4
start Nginx

View Task Task Manager There will be a nginx process.
In the browser input http://127.0.0.1 the Nginx welcome interface appears, indicating that the start Nginx successful.

Welcome to nginx!
If you are here page, the Nginx Web server is successfully installed and working. Further configuration is required.
For online documentation and support the refer to nginx.org.
Commercial support is available at nginx.com.
Thank for using Nginx.

Other actions:

Nginx-s Stop//     stops Nginx
nginx-s reload    //Reload configuration file
Nginx-s quit     //exit Nginx

Configuration file:

#user nobody; 
Worker_processes 1 #启动的线程数: The number of a kernel *2 #错误的位置和级别 #error_log logs/error.log; 
#error_log Logs/error.log Notice; 
 
#error_log Logs/error.log Info; #pid logs/nginx.pid #pid进程文件的位置 Events {worker_connections 1024; #每个进程的最大连接数} HTTP {include MIME. 
  Types 
  Default_type Application/octet-stream; #nginx日志格式定义, you can reference #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 #请求时间 #gzip on; open gzip compression #server为设置的虚拟机, you can set up multiple server {listen; #监听的端口 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 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$ {# ro 
    OT 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 ' one # #locatio 
    n ~/\.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; 
 #  } 
  #} 
 
}

Tip:
Run nginx-v to see which modules are supported by the platform's compiled version. My results here are:

Nginx version:nginx/0.7.65 TLS SNI Support enabled Configure arguments:--builddir=objs.msvc8--crossbuild=w In32--with-debug--prefix=--conf-path=conf/nginx.conf--pid-path=logs/nginx.pid--http-log-path=logs/access. Log--error-log-path=logs/error.log--sbin-path=nginx.exe--http-client-body-temp-path=temp/client_body_temp- 
  -http-proxy-temp-path=temp/proxy_temp--http-fastcgi-temp-path=temp/fastcgi_temp--with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs.msvc8/lib/pcre-7.9--with-openssl=objs.msvc8/lib/openssl-0.9.8k--with-openssl-opt= Enable-tlsext--with-zlib=objs.msvc8/lib/zlib-1.2.3--with-select_module--with-http_ssl_module--with-http_re Alip_module--with-http_addition_module--with-http_sub_module--with-http_dav_module--with-http_stub_status_ Module--with-http_flv_module--with-http_gzip_static_module--with-http_random_index_module--with-http_secur E_link_module--with-mail--with-mAil_ssl_module--with-ipv6 nginx version:nginx/0.7.65 TLS SNI Support enabled Configure arguments:--buil Ddir=objs.msvc8--crossbuild=win32--with-debug--prefix=--conf-path=conf/nginx.conf--pid-path=logs/nginx.pi D--http-log-path=logs/access.log--error-log-path=logs/error.log--sbin-path=nginx.exe--http-client-body-tem P-path=temp/client_body_temp--http-proxy-temp-path=temp/proxy_temp--http-fastcgi-temp-path=temp/fastcgi_temp-- with-cc-opt=-dfd_setsize=1024--with-pcre=objs.msvc8/lib/pcre-7.9--with-openssl=objs.msvc8/lib/openssl-0.9.8k-- 
  With-openssl-opt=enable-tlsext--with-zlib=objs.msvc8/lib/zlib-1.2.3--with-select_module--with-http_ssl_module --with-http_realip_module--with-http_addition_module--with-http_sub_module--with-http_dav_module--with- 
  Http_stub_status_module--with-http_flv_module--with-http_gzip_static_module--with-http_random_index_module --with-http_secure_link_Module--with-mail--with-mail_ssl_module--with-ipv6
 

View the Nginx process

Tasklist/fi "imagename eq nginx.exe"

Appears as follows:


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.