Server Load balancer-Can Nginx + php be used to separate php and static resources?

Source: Internet
Author: User
Can I only use Nginx to separate the front-end static resources from the php dynamic scripts? I have three servers on different servers and want to use one static resource. Can I use Nginx to separate the two dynamic php scripts? No. What should I add? How to configure it? Only use Nginx to separate static front-end resources from dynamic php scripts and place them on different servers
I have three servers and want to use one for static resources and two php dynamic scripts.
Can Nginx be implemented?
No. What should I add?
How to configure it?

Reply content:

Only use Nginx to separate static front-end resources from dynamic php scripts and place them on different servers
I have three servers and want to use one for static resources and two php dynamic scripts.
Can Nginx be implemented?
No. What should I add?
How to configure it?

Yes. Use the reverse proxy of the nginx upstream module.

Of course. Nginx fasct-cgi module can be implemented. You can also use the reverse proxy upstairs.

Nginx does this. nginx in this province can only process requests and cannot process scripts.

In fact, this problem can actually be irrelevant to nginx and php. Generally, you can directly resolve www.example.com to two PHP machines and resolve statics.example.com to the machines with static resources.

Let apache process php. proxypass :~~~~ Bla... the rest of the gzip will be processed using the gzip cache.

First, answer the question. The answer is yes, but there is a problem.
There are 3 too many servers. Why do we need to pull out a static server separately.
For O & M, this is not the legendary single point. In the case of availability deployment, it is necessary to avoid single points.
What if your static resource server crashes? The other two dynamic script servers do not have static files. How can this problem be solved.
Three machines can all be the same as fashion NGINX + PHP-FPM.
Use nginx upstream to achieve load balancing.

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.