Answer the question
In order to leave comments, you need to log in
Why files from a directory are not displayed in nginx?
Hello!
I have the following config for nginx:
server {
listen 443 ssl;
root /var/www/site;
index index.html index.htm;
server_name site;
ssl_certificate /etc/ssl/certs/site.crt;
ssl_certificate_key /etc/ssl/private/site.key;
location /morning/ {
alias /var/www/site/morning;
location ~* \.(jpg|jpeg|png|gif|ico|css|js|ttf)$ {
expires 365d;
}
}
}
Answer the question
In order to leave comments, you need to log in
Show error.log and the absolute path to the image
Or try replacing alias with root
And replace:
location /morning/ {
alias /var/www/site/morning;
}
location ~* \.(jpg|jpeg|png|gif|ico|css|js|ttf)$ {
alias /var/www/site/morning;
expires 365d;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question