How To Solve WP-DBManager Permission issue?

Daman asked:

I’ve installed WordPress on a LEMP stack which is powered by CentOS 6.4. I installed WP-DBManager plugin today and it’s showing an error which is mentioned below:

Your backup folder MIGHT be visible to the public

To correct this issue, move the .htaccess file from wp-content/plugins/wp-dbmanager to /var/www/

But guys how can I do this as Nginx does not support .htaccess file. Please tell me what permission should I give to backup-db folder that is located in wp-content folder.

The .htaccess file in the folder contains the following code:

<Files ~ ".*\..*">
order allow,deny
deny from all

At this time when I directly open that “backup-db” folder, ngnix shows a 403 Forbidden error. But the backups can easily be downloaded if someone has direct URL to the backup zip file located in that folder.

Please help me!

My answer:

That .htaccess just denies all requests. You can easily do the same in nginx with a second location. For instance this will deny every request in that directory:

location /wp-content/backup-db {
    deny all;

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.