Answer the question
In order to leave comments, you need to log in
How to give the contents of the directory by proxy_pass?
On one server there is a config that just gives static content
server {
listen 80;
server_name static.server;
root /var/www/cms;
location / {
autoindex on;
}
}
upstream static-server {
server static.server;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
location /static {
proxy_pass http://static-server/$host/;
}
}
location = /robots.txt {
proxy_pass http://static-server/$host/static/robots.txt;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question