Report this

What is the reason for this report?

Nginx: setup `public_folder` to serve html and similar files?

Posted on November 16, 2013

After installing the Ghost droplet (running Nginx) I’ve realised that there is no public_folder or www folder where I can drop random html files and other docs (e.g. Google Webmaster Tools domain verification file).

Is anyone aware of the configuration/changes required to have a public_folder up and running on Nginx without affecting the security of the server?



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!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

<pre> <br>server { <br> listen 80; <br> server_name www.ghost-blog.com; <br> rewrite ^/(.*) http://ghost-blog.com/$1 permanent; <br>} <br> <br>server { <br>root /usr/share/nginx/www; <br>index index.html index.htm; <br> <br>server_name localhost; <br> <br>location / { <br> try_files $uri $uri/ /index.html;
<br> } <br> <br>location /doc/ { <br> alias /usr/share/doc/; <br> autoindex on; <br> allow 127.0.0.1; <br> deny all; <br> } <br>} <br></pre>

Please pastebin your nginx virtualhost config file.

You can store such files in <code>/path/to/ghost/core/shared</code>.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.