Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Location of the Nginx default index.html file on MAC OS

Tags:

enter image description here

I have successfully installed nginx on my MAC with homebrew

brew install nginx

but i can't find from where is this default page called.

In nginx.conf under location says

root html;

and i can't find it. Please help.

like image 838
lewis4u Avatar asked Oct 03 '16 16:10

lewis4u


1 Answers

Lewis4u's answer may be right! But I think we should have a clearer explanation

In nginx.conf file we see the root path is:

root   html;

The question is: Where is "html" relative path? This relative path is set at compile time. You can check the path by command

$>nginx -V

You will see "--prefix=/usr/local/Cellar/nginx/1.12.0_1", this is the folder of nginx files. Now you should "cd" to this directory to see your "html" folder.

$> cd /usr/local/Cellar/nginx/1.12.0_1
$> ls -l html

Then you will see the "html" folder is a softlink to "/usr/local/var/www"

In conclusion, in my case, the "html" folder is "/usr/local/var/www". It may be different on your MAC. But hey, you got the method to find out. Right?!

like image 59
KennyHo Avatar answered Sep 22 '22 04:09

KennyHo