How to enable directory browsing function in nginx

王林
Release: 2020-08-25 16:32:59
forward
3946 people have browsed it

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
Copy after login

Add the following content below http:

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

Save the file and exit.

Restart nginx

service nginx reload
Copy after login

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!