Nginx Reverse Proxy

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

CentOS Install Apache command

Yum Install Httpd-y


Nginx installation Please see my blog post:

http://tianxingzhe.blog.51cto.com/3390077/1684642

First install Nginx and bind to 80 port, install Apache bound listening 8080 port. Then set the Nginx Server directory for the Www_nginx,apache server directory as Www_apache, respectively, in 2 directories to create a new index.html file, which is written in the Nginx,apache2 word is sufficient.

Then we configure the Nginx configuration file, generally nginx.conf this file, modify the configuration information inside.

Location/{

Proxy_pass http://127.0.0.1:8080;

}

At the same time to start Nginx and Apache, visit 127.0.0.1, you will find a magical thing, altogether output Apache, obviously nginx server directory there is no output, but Apache, that is because Nginx has a reverse proxy, Go to Apache to listen for the 8080 port to content, and then Apache returned to his processed results.

This is a simple example, in fact, we can let Nginx handle static pages, processing images, CSS, JS and other files, and let Apache handle dynamic files. For example, we can modify this:

Location ~ \.php$ {

Proxy_pass http://127.0.0.1:8080;

}

This is only PHP files to the Apache processing, the other is nginx to deal with.


Reference blog:


Http://www.cnblogs.com/Ihaveadream/p/4136377.html


This article is from the "Nothing-skywalker" blog, please be sure to keep this source http://tianxingzhe.blog.51cto.com/3390077/1684720

Nginx Reverse Proxy

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.