Report this

What is the reason for this report?

Nginx Security for wordpress & phpmyadmin

Posted on March 13, 2013

Hi all,

How do i protect phpmyadmin. Currently anyone can access example.com/phpmyadmin

how do i protect wordpress files and folders. I have seen tutorials on the web where nginx config links to a made up global restrictions file so you can link to it when creating new server blocks but im not sure if its up to date. http://codex.wordpress.org/Nginx



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!

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.

thanks roozbehk

Also how can i restrict phpmyadmin by ip?

echo “allow 127.0.0.1;” > /etc/nginx/allow_list <br>echo “allow 192.168.0.155; # whatever your ip is” >> /etc/nginx/allow_list <br>echo “deny all;” >> /etc/nginx/allow_list <br> <br>then wherever you want restrictions inplace <br> <br>include allow_list; <br> <br>Example that will restrict an entire domain: <br> <br>server { <br> server_name domain.com; <br> <br> root /var/www/; <br> error_log /var/log/nginx/error.log warn; <br> access_log /var/log/nginx/access.log; <br> include allow_list; <br> <br>} <br> <br>Example that will restrict one folder under one domain <br> <br> <br>server { <br> server_name domain.com; <br> <br> root /var/www/; <br> error_log /var/log/nginx/error.log warn; <br> access_log /var/log/nginx/access.log; <br> <br> location /wordpress/ { <br> include allow_list; <br> } <br>}

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.