Bobcares

Access Forbidden By Rule NGINX Magento | How To Fix It?

by | Feb 20, 2023

Are we getting an “access forbidden by rule” error at Magento in NGINX? At Bobcares, we can provide a solution for the issue with our Magento Development Services.

How to fix the “access forbidden by rule” error at Magento in NGINX?

Sometimes, we may see the below error:

access forbidden by rule nginx magento

These notifications are really beneficial because Magento would alert us in the admin panel if it could access the file through HTTP. This log message indicates that everything is in order. This error log appears when Magento attempts to access app/etc/local.xml through HTTP and fails. The key is that it should fall short. Otherwise, anyone with a browser may access http://example.com/app/etc/local and see the database credentials.

However, if we find these log messages annoying and are confident in the security of the server setup, we may delete this functionality with ease.

How to block the message?

Do not attempt to compromise the Magento core in order to remove this security check. Instead, we can simply remove this check by changing the admin-theme. The following file should be opened, or if not, it should be created:

access forbidden by rule nginx magento

Then include the below code:

access forbidden by rule nginx magento

By completely removing the blocks notification_security and notification_survey from the backend pages, the security check is skipped. No core hacks were used. Afterward, don’t forget to clear the layout cache. In conclusion, Magento attempts to reach app/etc/local.xml over HTTP but is unsuccessful, resulting in this error log. The key is that it should fail. If not, everyone would be able to see the database credentials.

[Looking for a solution to another query? We are just a click away.]

Conclusion

To sum up, our Support team went over the details of the method to block the “access forbidden by rule” error at Magento in NGINX.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.