HTTP Response-Codes for proxy-server (Nginx, Apache)

21 views Asked by At

Regarding reverse Proxy Servers, I have a question: An Apache and an NGINX are running on the same web server (X.X.X.X), with Apache listening on port 80. NGINX server's configuration file:

nginx
Copy code
location ~
    proxy_cache mycache;
    proxy_cache_valid 200 15m;
    proxy_cache_valid 404 10m;
    proxy_pass http://x.x.x.x:80;

Now if I have a script like timenow.py, which is located on Apache and outputs the current time (15:30 fe) and I have HTTP requests sent directly to Apache and to the NGINX server at different times. What output of the script will be transmitted in the HTTP response for each scenario. Also if the script was for instance accidentally deleted on Apache at 15:18 and restored at 15:31. The script was not called before 15:00. So 15:00, 15:10, 15:21, 15:32, 15;45 ? Do I get Responses from Nginx and Apache ?

I assume that at 15:00 Nginx Response is 404 and Apache is 200, then 15:10 both are 200, after 15:19 to 15:31 both are 404 (and nginx deletes script from cache) and after that its like the above except for the cache valid times. But ChatGPT cant answer this question and I am asking myself if there is a status code for forwarding a request from a proxy to the backend server (like 303/ 307) ?

0

There are 0 answers