解决nginx搭建图片服务器访问图片404

本人主要解决搭建nginx搭建图片服务器,然后访问图片404的问题  参考http://blog.csdn.net/javamoo/article/details/73716893

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;
}

猜你喜欢

转载自blog.csdn.net/cccfire/article/details/78757581