I have a backups directory, and I want to pull files from there using wget. But every time I try, I get 404.
When I try using wget, there is no new entry in the nginx error or access logs.
In the /etc/nginx/sites-enabled/default file, I turned on auto index (I added “autoindex on;”):
location /backups {
alias /home/django/django_project/django_project/backups;
autoindex on;
}
After doing that, I got a directory listing in my browser, and I could download the file by saving from there.
I do not want the directory to have a publicly accessible listing – I only want to download the files via wget.
How do I enable wget downloads?
Thanks
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.
Click below to sign up and get $100 of credit to try our products over 60 days!
I changed locations, and now, in the new location, wget is not working.
To recap, I want to wget files from a backups directory on the server to my local machine. In August, it was working. But I have since changed locations. Now, from my local machine in the new location, wget is not working, I get 404 Not Found. If I turn autoindex on, I can display the directory using a browser on my local machine, but only if I use the IP address, not the URL site name. I did this to troubleshoot, as I do not normally want the directory to display, I only want to download files using wget. So autoindex is now off.
I would appreciate some assistance to get wget working, thanks,
Hi @netvigator,
Wait, first, let me know please from where you are running your Wget command to where?
Additionally, do disable directory listing in Nginx, you need to add the following :
Inside your location blocks. Basically, like that:
That should do it.
Waiting for a bit more clarification on the other part of the question.