Nginx reverse proxy for Internet access

Source: Internet
Author: User
Tags nginx server nginx reverse proxy


Nginx reverse proxy needs to access the Internet: Because of project requirements, the Intranet server is required to access the public network address, and then capture data on the Internet for official web use. As we all know, internal server servers generally do not provide external access, and should not provide them with public network access permissions. Therefore, considering the use of front-end nginx as a reverse proxy, internal server access is achieved: internal Server IP: 10.100.0000100 & 10.100.0000101 nginx Intranet IP: 10.100.000099 in nginx. make the following changes in the conf file: www.2cto.com server {resolver 202.106.0.20; listen 8002; location/{proxy_pass http: // $ host $ request_uri; proxy_redirect off; proxy_set_header Host $ host; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ balance; allow10.100.20.0/24; denyall ;}} www.2cto.com where resolver is the DNS address, it is generally recommended that the DNS server of the nginx server be the same: Second, configure the proxy information of the backend server: linux machine, run: vim/etc/profile to add export http_proxy = http: // 10.100.000099: 8002 source/etc/profile can be used on windows machines. In the IE option, choose-connection-LAN Settings-configure proxy server, and enter the corresponding IP address and listening port.
 

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.