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.