Question

Can't access Volume from NGINX

I have a Droplet running named XXX.

Inside /etc/nginx/sites-enabled/XXX.xx

I have the following configuration.

server {

   server_name XXX.xx  www.XXX.xx;

   location / {
     proxy_pass http://localhost:5000;
     proxy_http_version 1.1;
     proxy_set_header Upgrade $http_upgrade;
     proxy_set_header Connection keep-alive;
     proxy_set_header Host $host;
     proxy_cache_bypass $http_upgrade;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header X-Forwarded-Proto $scheme;
    }

    location /images/ {
        alias /mnt/XXXblob/images/;
    }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/XXX.xx/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/XXX.xx/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


}

Before that I also have runned

sudo chown -R www-data:www-data /mnt/XXXBlob/images/

When I look up /etc/fstab it has the following content.

LABEL=cloudimg-rootfs / ext4 defaults 0 0 LABEL=UEFI /boot/efi vfat defaults 0 0 /dev/disk/by-id/scsi-0DO_Volume_XXXBlob /home/portal/XXXBlob ext4 defaults,nofail,discard 0 2

Any help are appreciated!


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi there,

According to the fstab, your volume should be mounted at /home/portal/XXXBlob. What is the output of the following command:

df -h

What I could suggest here is to mount the volume not on /mnt but inside your document root, so for example if your website files are hosted at /var/www/html/ you could mount the disk to images folder at /var/www/html/images.

Regards, Bobby