By Supergeante
Hi all,
i’ve created trough sftp another folder near my ghost folder in nginx environnment: /var/www/ghost /var/www/folderx
Ghost works find but i don’t find out how to acess the folderx trough http://myurl.tld/folderx
Used to an apache environment i don’t see how to do this under nginx.
Could you help ?
Thx
SPG
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!
Add an index.html and try to access it myurl.tld/folderx/index.html
What do the NGINX error logs have to say ? Could you share your logs ?
This comment has been deleted
It sounds like you’re pretty close. You can set this up with an alias directive in your Nginx configuration:
server {
listen 80 default_server;
server_name my-ghost-blog.com;
root /var/www/ghost;
index index.html index.htm;
client_max_body_size 10G;
location / {
proxy_pass http://localhost:2368;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
}
location /folder/ {
alias /var/www/folder/;
autoindex on;
}
}
The key thing here for being able to browse through the directory structure is the addition of autoindex on Also, make sure the folder has the correct permissions:
sudo chown -R www-data:www-data /var/www/folder/
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.