本人主要解决搭建nginx搭建图片服务器,然后访问图片404的问题
cd /usr/local/nginx
vim nginx.conf
nginx.conf
博主的错误是local刚开始写的是
location /images/ {
root /home/gx/images/;
autoindex on;
把root改成alias就行了
server {
listen 80;
server_name localhost;
charset koi8-r;
access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
location /images/ {
alias /home/gx/images/;
autoindex on;
}
其实最重要的就是 localtion => root 改为 alias 然后就解决了相关问题
困扰了我好久,立帖为证,存档!