Linux under Nginx Server domain name specified directory

Source: Internet
Author: User
Tags nginx server

In general, after the domain name designated IP, the IP is located in the machine to specify the corresponding site directory, otherwise the domain name will not work;

The following is the details of the NGINX server specified directory under Linux:

The configuration file for the domain binding directory is put here:/usr/local/nginx/conf/vhost/

Under Change directory, create a new file named: Domain name. conf: www.baidu.com.conf

The content might look like this:

server{        listen       ;        server_name  www.baidu.com;        Index index.html index.htm index.php;        Root  /var/www/html/homepage/;        CharSet Utf-8;        Location ~.*\. (Css|js|swf|jpg|gif|png|jpep|jpg|mp3|xx|xmlbak|xml) $ {                expires       720h;        }        Access_log off;        Location ~. *\.php$        {                include fcgi.conf;                Fastcgi_pass  127.0.0.1:8888;                Fastcgi_index index.php;                Expires off;                Access_log off;                      }}

Then put your site content into the directory:/var/www/html/homepage/below the line;

Linux under Nginx Server domain name specified directory

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.