Nginx 静态下载站点
示例配置:
static.conf
server {
listen 80;
server_name www.example.com;
charset utf-8;
location / {
root /home/www; # 指定根目录
index NON_EXISTENT_FILE; # 指定index是一个不存在的文件,这样就可以通过ngx_http_autoindex_module模块处理
autoindex on; # 启用目录列表输出
}
access_log /var/log/nginx/static_access.log main;
error_log /var/log/nginx/static_error.log;
}公开静态站点,站点根目录就是 /home/www 中的文件