By nathanmace
I setup a VPS running the Ghost application using the pre-made offering. How can I setup Nginx to serve up a plain http directory for images and misc files that aren’t part of the Ghost blog? Everything I do results in a Ghost 404 page not found error.
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!
You could try setting up a PHP server with tasksel and create an image folder and serv files through there. https://gist.github.com/nahtnam/8092251 Im not sure it would work though.
Edit it the file “/etc/nginx/conf.d/default.conf” and add a new location block so that it looks like: <br> <br><pre> <br>server { <br> listen 80; <br> server_name my-ghost-blog.com ; <br> <br> client_max_body_size 10M; <br> <br> location / { <br> proxy_pass http://localhost:2368/; <br> proxy_set_header Host $host; <br> proxy_buffering off; <br> } <br> <br> location /files { <br> root /var/www; <br> } <br>} <br></pre> <br> <br>Then create a directory named “/var/www/files” Now any files that you put in that directory will be available at: http://yourdomain.com/files/yourfile.ext
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.