Displaying Files like phpinfo.php Nginx

Problem I was having was is basically I cannot run a simple info.php inside my public_html after doing some research I came up with this rewrite if you’ve any other solution do let me know it works for me.


This is to display all files inside your /home/domain/public_html

location / {

location ~ ^/(.+.php)$ {
try_files $uri =404;
root $MAGE_ROOT;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
try_files $uri $uri/ /index.php?$args;


Leave a Reply

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