Here, we are trying to understand a few concepts: web server, nginx, proxy, reverse proxy, static resources
How to get resources on the server
Now we know
In fact, the Internet is no mystery
That client requests to the server resources
According to the server asked to return, and nothing more
If I have a centos server with a public network ip
Suppose I know the following path on the server: / ststics
How do I go to get the resources above it?
Like opening web sites
We tried to enter the ip / ststics browser
Not surprisingly, then
You will see the above connection refused to return
Yes, because the server does not know what to do
web server
Although the above we have one physical machine
But this machine is still unable to understand the browser sent me the request for resources
As a result, there has been a software
Installed on the server, you can listen for specific ports
And make the appropriate response to a particular request
This software is called a web server
Common: nginx, apache
We tried again a web server accessible via a browser installed server
The server returned a html file that can not be accessed above the current directory
At least, we know that in doing server, and have responded
proxy? Reverse proxy?
Now we know
A web server is the librarian of the physical server
All requests from the client will go through a web server
and then return to the web server access to resources from the physical machine to the client
It seemed as if dealing with a web server on the client
So web server is the client's agent, on behalf of the client to take on a physical machine resources
Meanwhile, web servers, the physical server is a reverse proxy, the proxy server in response to a physical client's request
Proxy and reverse proxy, is only two terms
Self-cultivation of a librarian
As a librarian, and most importantly, we need to know the location of each resource, and if this is not a simple goods, but to processing a part, you should turn to
We have such a document that says all the answers
He was known as the "librarian of self-cultivation"
Also called profiles, for example we nginx
The basket that says only listening for requests on port 80, other ports ignore him
Yellow box that says, if access is the root directory, and other files to the root directory to find index.php
Red box that says, if the requested file is xx.php people on the local port is transferred to the 9000 and 9000 ports on the defendant, with his xx.php came to the index.php and follow them there way to deal
Green box that says, if the request is js, css or other static resources, then go looking for the appropriate path
For example, our html file that says <link href = "js / iCheck / skins / minimal / minimal.css" rel = "stylesheet">
Then, go to / usr / share / nginx / html / value / application / views / admin / following js / iCheck / skins / minimal / minimal.css find
This is a static resource nginx reverse proxy
By the way, who do the ports above 9000?
php-fpm it!
Not just one too! It is a working group!