Answer the question
In order to leave comments, you need to log in
How to properly configure nginx upstream?
There are 6 web servers with unique content (static files)
I want to combine them all into 1 web server with file caching
here is the code that I put together
but it turned out to be not an ideal solution
upstream backend {
server 1.1.1.1:80;
server 2.2.2.2:80;
server 3.3.3.3:80;
server 4.4.4.4:80;
server 5.5.5.5:80;
server 6.6.6.6:80;
}
server {
listen 80;
server_name dl.site.com;
root /var/www;
location / {
error_page 404 = @none;
}
location @none {
internal;
proxy_pass http://backend;
proxy_store on;
proxy_temp_path /var/www;
}
}
Answer the question
In order to leave comments, you need to log in
upstream backend {
server 1.1.1.1:80;
server 2.2.2.2:80;
server 3.3.3.3:80;
server 4.4.4.4:80;
server 5.5.5.5:80;
server 6.6.6.6:80;
}
location / {
proxy_pass http://backend;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_next_upstream error timeout http_404;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question