Powerdns and Nginx in combination with the domain name and IP access to the Web server 80 port when jumping to different pages

Source: Internet
Author: User

1.powerdns settings

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6F/60/wKiom1WaTfqB55koAAHs-TR85D0250.jpg "title=" Qq20150706174216.jpg "alt=" Wkiom1watfqb55koaahs-tr85d0250.jpg "/>

2. Internal website Introduction

Web server using Nginx, intranet DNS using Powerdns.


The functions you want to implement are as follows

Jump to the A page via IP access, and let it jump to page b when accessed via the domain name. Both methods have a port of 80.

Page A corresponding Nginx configuration

server {
Listen 80;
server_name localhost;

#charset Koi8-r;
CharSet Utf-8;

Access_log Logs/localhost.access.log Main;
Error_log Logs/localhost.error.log;

root/var/www;
Index index.php index.html index.htm;

AutoIndex on;
Autoindex_exact_size off;
Autoindex_localtime on;


Location/{

}

Page b corresponding Nginx configuration

server {
Listen 80;
server_name Zhidao. aaa.com;

#charset Koi8-r;
CharSet Utf-8;

Access_log Logs/localhost38.access.log;
Error_log Logs/localhost38.error.log;

Location/{
root/var/www/q2a/question2answer-1.7;
Index index.php index.html index.htm;
AutoIndex on;
Autoindex_exact_size off;
Autoindex_localtime on;

}

After configuration, restart Nginx,

[Email protected] conf]#/usr/local/nginx/sbin/nginx-s Reload

3. Testing

Access via IP


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6F/60/wKiom1WaUMPBHSsvAAEYwD4HT28683.jpg "style=" float: none; "title=" qq20150706175520.jpg "alt=" Wkiom1waumpbhssvaaeywd4ht28683.jpg "/>

Access by domain name

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6F/5E/wKioL1WaUtmw_ivFAAIiXjq1Bho962.jpg "title=" Qq20150706175425.jpg "alt=" Wkiol1wautmw_ivfaaiixjq1bho962.jpg "/>



As you can see, the two jump to different pages, respectively.

Powerdns and Nginx in combination with the domain name and IP access to the Web server 80 port when jumping to different pages

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.