Home  >  Article  >  Operation and Maintenance  >  How to enable directory browsing function in nginx

How to enable directory browsing function in nginx

王林
王林forward
2020-08-25 16:32:594026browse

How to enable directory browsing function in nginx

Nginx disables directory browsing after the default installation.

(Recommended tutorial: nginx tutorial)

If you want to enable the directory browsing function, please do the following:

Edit the nginx configuration file nginx.conf

vi /usr/local/nginx/conf/nginx.conf

Add the following content below http:

autoindex on;  #开启nginx目录浏览功能,on为开启,off为关闭
autoindex_exact_size on;  #显示文件大小从KB显示
autoindex_localtime on #显示文件修改时间,为服务器本地时间

Save the file and exit.

Restart nginx

service nginx reload

Open the browser and enter the address, you can see that the directory browsing function is turned on.

How to enable directory browsing function in nginx

The above is the detailed content of How to enable directory browsing function in nginx. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete