Nginx installation and configuration under Windows

Source: Internet
Author: User

Go to nginx official website to download the corresponding version

: Http://nginx.org/download/nginx-1.6.2.zip

Download complete decompression and put it in your favorite directory; the landlord put it in the F:\nginx.

Enter the cmd window of Windows and enter the command as shown below:

C:\USERS\YIXIAN>F:F:\>CD Nginxstart   Nginx.exe

After successful startup, you can see that the Nginx.exe process has started in Windows Task Manager

Next, you can enter 127.0.0.1 in the browser to see

Welcome to nginx! remember not to forget to turn off the Windows IIS server,

Nginx corresponding command

Nginx.exe-s Stop//                   stop nginxnginx.exe-s Reload                //Reload Nginxnginx.exe-s quit                     //exit Nginx
Note: The above command,. exe, may not be used

The relevant configuration of Nginx is in the conf/nginx.conf, of course.

#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, #nginx日志格式定义, can be referenced below #log_format main ' $remote _addr-$remote _user [$time _l Ocal] "$request" ' # ' $status $body _bytes_sent "$http _referer" ' # ' "$http _user_ag    Ent "" $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 servers {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$ {# ProX        Y_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 # #l        ocation ~/\.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; #    }    #}}







Nginx installation and configuration under Windows

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.