As all of us uses the HTTP protocol for accessing the web, and request at the port number 80 of the server, now suppose i want to browse or download a file then i will request to the HTTP server by specifying the complete URL.
If the server is having file, it would return it if it is not having the file then what will it do?
I think it will make the request to the appropriate server which would be having this file and get the file and return to us.
In this way does the HTTP server acts as an intermediate between the client and the server?
Please correct me if i am wrong here.
Many many thanx in advance
The web server simply return the requested file if allowed/available. Otherwise, it returns the appropriate error (404 for not found, 403 for forbidden, etc..). You can have a look HTTP codes for a more complete list.
I think you mean the case when a web page contains several resources that are not all hosted locally. In this case, your browser will request each resource from the right server according to the URLs found in the page.
Source : Link , Question Author : Luv , Answer Author : Khaled