Configuration of Nginx

Source: Internet
Author: User

The nginx.conf file in the/usr/local/nginx/conf directory is the nginx configuration file.

1 Configuring virtual machines with Nginx

1.1 Differentiating virtual machines by port

Add a server node to the nginx.conf file and modify the port number to

server {    listen       Bayi;    server_name  localhost;    #charset Koi8-r;    #    #        #access_log  logs/host.access.log  main;    # location    /{          root   html81;          Index  index.html index.htm;     }                                              }

http://192.168.81.128:81/

Access the index.html file under the html81 folder

1.2 Differentiating virtual machines by domain name

Here we can complete the task of domain name resolution by modifying the IP address of the domain name specified by the host file

Host file location: C:\Windows\System32\drivers\etc

The nginx.conf configuration file needs to be modified.

The configuration file needs to be reloaded after the configuration is modified.

At this point access

www.taobao.com/

Access is the index.html under the Html-taobao folder

Configuration of 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.