server {
listen 80 default;
server_name _;
root /alidata/www/default //这个就是静态文件的地址 绝对路径
index index.html index.htm index.jsp;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico|svg|htm)$ {
expires 30d;
access_log off;
}
location ~ .*\.(js|css)?$ {
expires 1d;
access_log off;
}
location ~ .*\.(html)$ {
proxy_pass http://127.0.0.1:8080;
}
location ~ /revitbus {
proxy_pass http://127.0.0.1:8080;
}
#access_log /alidata/log/nginx/access/default.log;
access_log off;
}

本文详细介绍了Nginx服务器配置的各项参数,包括如何设置监听端口、指定域名、配置静态资源缓存时间及代理转发等关键操作。适用于希望深入了解Nginx配置细节的技术人员。
4007

被折叠的 条评论
为什么被折叠?



