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:
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:
Then include the below code:
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.
var google_conversion_label = "owonCMyG5nEQ0aD71QM";
0 Comments