windows Nginx资源服务器搭建

379 阅读1分钟

1.下载

nginx.org/en/download…

下载完成后

2.配置

找到 conf 目录里的 nginx.conf 文件,配置Nginx

在结尾大括号之前添加:

include C:/Users/28332/Desktop/upload/upload.config;

在桌面创建upload文件夹,文件夹中创建upload.config

server
{ 
  charset utf-8;
  listen 8089;
  server_name http_host;
  root C:/Users/28332/Desktop/upload;
  autoindex on;
  add_header Cache-Control "no-cache, must-revalidate";
  location / { 
    add_header Access-Control-Allow-Origin *;
  }
}

3.启动

打开cmd,cd到nginx.exe所在目录输入命令

start nginx

然后在网页中输入localhost:8089就可以看见