标签:mamicode list http ati 注意 直接 page inf 大小
这里准备了一个文件夹,里面放入了一个img文件夹和index.html文件,将文件上传到home下。
这里我们从新起个端口
server {
listen 90;
server_name localhost;
location / {
root /home/static_kevin;
index index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
注意
这里访问的时候,是访问 /home/static_kevin
然后再加上你输入的地址
alias
配置 location /kevin {
alias /home/static_kevin;
}
这里直接访问 /home/static_kevin/
下面的内容
location / {
root /home;
}
location = /imooc/img/face1.png {
root /home;
}
#符合图片的显示
location ~* \.(GIF|jpg|png|jpeg) {
root /home;
}
#GIF必须大写才能匹配到
location ~ \.(GIF|jpg|png|jpeg) {
root /home;
}
location ^~ /imooc/img {
root /home;
}
标签:mamicode list http ati 注意 直接 page inf 大小
原文地址:https://www.cnblogs.com/zhenghengbin/p/12111074.html