Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to solve the problem of setting up directory browsing and Chinese garbled codes in nginx

Shulou Source: shulou.com Published: 2022-06-01 12:24:10 10月06日 Update

This article mainly explains "how to set up directory browsing in nginx and how to solve the problem of Chinese garbled code". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn how to set up directory browsing and how to solve the problem of Chinese garbled code in nginx.

The entire directory is not allowed to be listed by default under Nginx. If this feature is required

Open the nginx.conf file first and add it to the location server or http section

Autoindex on

It is best to add the other two parameters:

Autoindex_exact_size off

The default is on, which shows the exact size of the file, in bytes.

After changing to off, the approximate size of the file is displayed, in kB or MB or GB

Autoindex_localtime on

The default is off, and the file time displayed is GMT time.

Note: when changed to on, the file time displayed is the server time of the file.

At this point, I believe you have a deeper understanding of "setting up directory browsing in nginx and how to solve the problem of Chinese garbled code". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: File directory time garbled problem Chinese central browsing content unit size learning practical deeper two interest function parameter practicality actual Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker OPPO Reno Shulou Information vpn NVidia