403 Forbidden on Zip Files Download

Posted April 29, 2020 5.1k views

Hello, when I try to download a zip file on my web site it gives me a 403 Forbidden nginx error, I already saw the file permission and it’s with a 644 permission.
Does someone knows how to fix it?

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.

Submit an Answer
1 answer

Hi @bevanessasuryamkt,

This usually means you should give the user that runs the nginx process permissions to read the file.

This user that runs the nginx process is configurable with the user directive in the nginx config, usually located somewhere on the top of nginx.conf:

user www-data

You’ll need to use the change ownership command - chown on your file.

chown www-data:www-data my-file.html

If your whole directory/files are like that you’ll need to do it recursively.

chown -Rv www-data:www-data /path/to/home/directory

Please be careful with the path to your home dir and make sure it’s the correct one.