f:f:\>cdgx\nginx-1.16.1#Start command f:\gx\nginx-1.16.1>startnginxf:\gx\nginx-1.16.1> After the service is started successfully"/> f:f:\>cdgx\nginx-1.16.1#Start command f:\gx\nginx-1.16.1>startnginxf:\gx\nginx-1.16.1> After the service is started successfully">

Home  >  Article  >  Operation and Maintenance  >  How to configure nginx file server in windows10 system

How to configure nginx file server in windows10 system

WBOY
WBOYforward
2023-05-16 17:55:063110browse

nginx official website Download the windows version of nginx:

How to configure nginx file server in windows10 system

Unzip the downloaded software package:

Note:

The path to the decompressed package cannot contain Chinese characters, otherwise the nginx service cannot be started


How to configure nginx file server in windows10 system

Start the nginx service:

"Windows key r key" to open the run, enter "cmd" to enter the "dos terminal"

c:\users\administrator>f:
f:\>cd gx\nginx-1.16.1
# 启动命令
f:\gx\nginx-1.16.1>start nginx
f:\gx\nginx-1.16.1>

How to configure nginx file server in windows10 system

After the service is started successfully, there will be two in the task manager "nginx" process

How to configure nginx file server in windows10 system

Modify the configuration file and restart nginx

above the "https server block" of the "nginx.conf" file Add the following lines

# 添加文件管理器 
# 显示目录
autoindex on;
# 显示文件大小
autoindex_exact_size on;
# 显示文件时间
autoindex_localtime on;
 
server {
listen    8888;
server_name localhost ;
# 本地文件路径
# 注意不能直接以整个逻辑磁盘f:\ 为目录路径,要f:\英文目录名
root f:\gx\chiron ;
}

Reload the nginx service

# 重新加载nginx服务命令
f:\gx\nginx-1.16.1>nginx.exe -s reload

f:\gx\nginx-1.16.1>

Web browser access verification: Here I am in the "f:\gx\chiron" directory in advance , created a new "test.txt" file for test access address:

How to configure nginx file server in windows10 system

Note:

1. The directory name and file name must use English characters. Download normally;

2. Files with Chinese characters may display garbled characters, and when downloading, a "500 internal server error" error may be reported. Windows version of nginx related commands:

nginx -s stop         //停止nginx
nginx -s reload        //重新加载nginx
nginx -s quit         //退出nginx
start nginx          //启动nginx

Set the PC to start automatically at c:\users\administrator\appdata\roaming\microsoft\windows\start menu\programs\startup. Generate a shortcut for "nginx.exe" to the above directory

How to configure nginx file server in windows10 system

The above is the detailed content of How to configure nginx file server in windows10 system. For more information, please follow other related articles on the PHP Chinese website!

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