nginx 发布静态资源最大的优势就是节省资源了,把我的环境配置的nginx配置记录下;
修改nginx的默认配置文件
默认文件的位置
在文件的后面加上
include /home/soft/nginx/conf.d/*.conf;
添加发布的配置文件
内容如下
server {
listen 80;
server_name 192.168.209.202;
#server_name localhost;
location /download/ {
root /home/soft/nginx/;
autoindex on;
if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})T(\d{2})") {
set $year $1;
set $month $2;
set $day $3;
}
access_log /home/soft/nginx/log/download.access.log.$year$month$day main;
error_log /home/soft/nginx/log/download.error.log;
}
}
网友评论