My app store images on the backedn side in nodejs folder: /images. After publish it to Ec2 I don't have an access to these images by url like:
Is it the configuration problem or permission or something else? I will be grateful for help!
CodePudding user response:
The correct configuration should be:
server {
charset utf-8;
listen 80 default_server;
server_name _;
location / {
root /opt/front-end/;
try_files $uri /index.html;
}
location /api {
proxy_pass http://localhost:4000;
}
location /images {
autoindex on;
alias /opt/back-end/images/;
}
}