Answer the question
In order to leave comments, you need to log in
Why doesn't proxying static files work?
There is a config that simply gives the contents of the directory
server {
listen 80;
server_name media.static;
root /home/myname/stuff;
location / {
autoindex on;
}
}
/home/myname/stuff/название_домена/static/robots.txt
upstream public-api {
server public.api;
}
upstream media-static {
server media.static;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
location / {
proxy_pass http://front/;
}
location /robots.txt {
proxy_pass http://media-static/$host/static;
}
}
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