Hello,
I’m struggling with an issue for more than 2 weeks.
I have an nginx and pm2 setup. The issue is when I upload a file,
I can’t access the image through a url like http://[ip]/static/uploads/2018/08/articles/1/image.jpg
In some weird scenarios I can see the image uploaded, but in most cases I don’t. If I try to open the image in the browser it redirects to the defaul url.
I’ve checked that the image is saved in the right path. I’ve also checked nginx and pm2 error log files and they are clean.
I suppose I should configure in nginx a path for static files, but not sure how.
The nginx config for sites-available default is
root /root/app/app1.com/dist;
server_name [ip];
location / {
try_files $uri $uri/ /index.html;
}
Any help is appreciated,
Thanks.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.