Nginx configuration domain name jump instance

Source: Internet
Author: User

Requirements: After entering qj.123.com in the browser address bar, the address automatically becomes qj.abc.com

Configure Nginx Jump

server {
Listen 80;
server_name qj.abc.com qj.123.com;
Set $domain qj.abc.com;
Index index.php index.html index.htm;
root/home/web/$domain/htdocs/;

if ($host = ' qj.123.com ') {
Rewrite ^/(. *) $ http://qj.abc.com/$1;
}

Location/{
Index index.php index.htm index.html;
Root $domain;
}

Location ~. *\.php${
Include fcgi.conf;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Expires off;
Access_log/home/logs/nginx/qj.abc.log;
}

}

"Symbolic parsing"

^ Start of matching string

/Match the delimiter of the domain name

. Match any character other than line break

* Repeat 0 or more times

Match any character (. *)

. * matches any text

$ match End of string

Nginx configuration domain name jump instance

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.