Tuesday, June 18, 2013

How to change nginx root directory

Update the /etc/nginx/sites-enabled/default file -- change the document root directive in the server section

 server {  
     #listen  80; ## listen for ipv4; this line is default and implied  
     #listen  [::]:80 default ipv6only=on; ## listen for ipv6  
     root /usr/share/nginx/www;  
     index index.html index.htm;  
 ...

By default the root is installed in /usr/share/nginx/www.


No comments:

Post a Comment