Back to Blog

Displaying Files like phpinfo.php Nginx

January 11, 20171 min read0 comments
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. Nginx This is to display all files inside your /home/domain/public_html
location / {

location ~ ^/(.+.php)$ {
try_files $uri =404;
root $MAGE_ROOT;
fastcgi_pass 127.0.0.1:9000;
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;
}
 

Enjoyed this article?

Show your appreciation with a clap

0claps
Share this article
SK
Written by

Sohaib Khan

View all posts

You might also like

View all

Comments (0)

No comments yet. Be the first to comment!