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

来源:互联网 发布:金庸群侠传mac版 编辑:程序博客网 时间:2024/06/05 01:11

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

cd /usr/local/nginxvim 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;}

原创粉丝点击