Question
How to use block storage for existing website without delete/moving it to the block storage?
How to use block storage for existing website without delete/moving it to the block storage?
my /dev/sda1 is now full, I attach a new volume like 50GB, and it already mouted in /mnt/volume....
I’m using easyengine nginx to host my website. My website is located at /var/www/example.com/htdocs, and I want to use my block storage to save my wp-content that located in /var/www/example.com/htdocs/wp-content. so It will saved in block storage… what should I do? I’ve try this
Link
I try this
mkdir /mnt/volume.../wp-content
sudo chown -R www-data:www-data /mnt/volume.../wp-content
and edit /etc/nginx/sites-enabled/default
and add this to the last line
location /wp-content/ {
alias /mnt/volume.../wp-content/;
}
after that, I save it, and restart nginx service, and it got error serverctl1....
can you help me how to implement this?
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.
×
Check your nginx config file for errors using this command:
What does it output?
it said like this
here is /etc/nginx/nginx.conf file
and here is /etc/nginx/sites-enabled/default
You have defined the
wp-content
block outside of theserver
block, in the/etc/nginx/sites-enabled/default
file. That causesnginx
to fail.Move it to the first
server
block, for example afterlocation /
block (you can put it anywhere as long as it’s in the firstserver
block):Then, try to run
nginx -t
again, and if everything is okay, restart Nginx to put changes in the effect:sudo systemctl restart nginx
.thanks, it’s worked..
but when I upload an image to my site, it’s still saved in example.com/htdocs/wp-content/....
it’s not saved in /mnt/vol…/wp-content
is there something wrong? or I was missunderstood about aliases?