Dns+nginx Reverse proxy (Super detail OH) ~

Source: Internet
Author: User
Tags nginx reverse proxy

Environment Description:

192.168.1.1: Build Dns+nginx Service

192.168.1.2: Building Nginx Service

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/7D/wKioL1XlFSiSnPHgAADln-p9zsw640.jpg "title=" dns+ Nginx reverse proxy. png "height=" 341 "width=" 620 "alt=" Wkiol1xlfsisnphgaadln-p9zsw640.jpg "/>

Build as follows:

1. yum-y Install DNSMASQ Installation DNS service (-y means mandatory installation, Yum installed path is in/etc directory)

2. Start service dnsmasq start or/ETC/INIT.D/DNSMASQ start (two methods are OK)

3. modify the main profile of the DNS service vim/etc/dnsmasq.conf (vi and VIM is the difference between the font color in the file), by default, the DNS service listens on the port is native 127.0.0.1, but build the internal DN S is to allow the intranet PC to properly parse other domain names , so you need to modify the following configuration

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/72/7D/wKioL1XlF_ywu96HAADYz2Oetc8674.jpg "title=" dnsmasq.conf master configuration file. png "alt=" wkiol1xlf_ywu96haadyz2oetc8674.jpg "/>

4. Then add addn-hosts=/etc/dnsmasq.hosts on the last line of the/etc/dnsmasq.conf file (DNS resolves the domain name through dnsmasq.hosts, not through its own local Hosts file for address resolution)

5. To see how the configuration file is parsed

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/81/wKiom1XlGjGjk8YiAAE5k7wt65M755.jpg "title=" 123. PNG "height=" 182 "width=" 563 "alt=" wkiom1xlgjgjk8yiaae5k7wt65m755.jpg "/>

6. As the intranet DNS, then the office staff not only to access the intranet, but also to access the intranet, look at the configuration

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/72/81/wKiom1XlHuqx8eUpAACgPqAIOvY971.jpg "title=" 111. PNG "height=" width= "521" alt= "wkiom1xlhuqx8eupaacgpqaiovy971.jpg"/>

7. Build 192.168.1.1 Nginx (here slightly), the following to configure the Nginx reverse proxy, the proxy 192.168.1.2 (nginx) port to define their own, and then restart Nginx

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/81/wKiom1XlIIngDMbaAAJMZWYm0es621.jpg "title=" up.png "height=" 430 "width=" 607 "alt=" wkiom1xliingdmbaaajmzwym0es621.jpg "/>

PS: This Dns+nginx reverse proxy configuration is complete

If you have questions or add qq:1050784459




This article is from "Wang Hai's blog" blog, please be sure to keep this source http://hason.blog.51cto.com/8271396/1690435

Dns+nginx Reverse proxy (Super detail OH) ~

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.