Introduction to installing and using Windows Nginx

Source: Internet
Author: User

One of the Nginx functions can start a local server and access the target file by configuring the server_name and root directories. Download http://nginx.org/download and unzip two. Modify the configuration file

Nginx config file in nginx-1.8.0\conf\nginx.conf

HTTP {     gzip on  ;    #静态文件    Server {        listen       ;        server_name  static.cnblog.com;        Location/{            root   g:/source/static_cnblog_com;        }    }    #html文件    Server {        listen       ;        server_name  127.0.0.1 localhost;        Location/{            root   g:/source/html/mobile/dist;            Index  index.html index.htm;}}}    

If you can configure multiple servers so that access to localhost is accessed to the g:/source/html/mobile/dist directory, you can also turn on gzip, compress HTML

Three. Startbe careful not to double-click on the Nginx.exe, which will cause the configuration to restart after modification, stop nginx Invalid, you need to manually close all the Nginx process in the Task ManagerIn the Nginx.exe directory, open command line tool, start/close/restart Nginx with command: Start nginxnginx-s Reload: Reload after modifying configuration nginx-s reopen: Reopen log file
NGINX-T-c/path/to/nginx.conf Test nginx configuration file is correct

Close Nginx:
Nginx-s stop: Fast Stop Nginx
Nginx-s quit: Complete and orderly stop nginx



Introduction to installing and using Windows Nginx

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.