歡迎您光臨本站 註冊首頁

nginx 不能讀取圖片。萬般無奈來求助

←手機掃碼閱讀     火星人 @ 2014-03-03 , reply:0

nginx 不能讀取圖片。萬般無奈來求助

nginx 不能讀取圖片。萬般無奈來求助


好多天了。找不個頭緒。來這裡問問nginx前輩們。3Q。
具體描述:
我的站點環境 : web伺服器   圖片伺服器 兩台。 站點根目錄 /xxx/www/domain.com/public/    站點圖片文件統一放在images/下面。 站點圖片在第一次訪問的時候會判斷,如果圖片不存在,就去圖片伺服器下載,放在圖片目錄。

現在的情況是:圖片無法顯示,如果我把圖片全部直接放在images文件夾,顯示正常。 否則圖片無法顯示(也就是沒有去圖片伺服器下載圖片),直接訪問圖片地址,顯示No input file specified.  我的判斷是沒有能讀取imageserver文件夾下的php文件。但是我始終無法解決。 望前輩們給予指點。3Q啦。

images內部文件包括
.
`-- imageserver
    |-- client.php
    |-- etc
    |   `-- client.settings.php
    `-- lib
        `-- hello.php


我的虛擬主機配置如下。
server
{
        listen  80;
        server_name    domain.com;
        index   index.html  index.htm  index.php;
        root    /xxx/www/domain.com/public;
        access_log      /xxx/logs/domain_log access;

         location / {

                if (!-e $request_filename) {
                        rewrite sale/all$ index.php?q=sale/list last;
                        rewrite sale/all-(+)\.html$ index.php?q=pages/list&page=$1 last;
                        rewrite pages-(+)-(+)\.html$ index.php?q=news/view&action=$1&aid=$2 last;
                        rewrite new_pages-(+)\.html$ index.php?q=new_arrivals&page-$1 last;
                        rewrite pages/list-(+)\.html$ index.php?q=pages/list&page=$1 last;
                        rewrite (+books)-(+)\.html$ index.php?q=books/list&cate_name=$1&page=$2 last;
                        rewrite (+)-(+)\.html$ index.php?q=books/view&action=$1&itemno=$2 last;
                        rewrite (+books)\.html$ index.php?q=books/list&cate_name=$1? last;
                        rewrite search_(.*)_(.*)\.html$ index.php?q=procduct/list&search_type=$1&keyword=$2 last;
                }   
                if (!-e $request_filename) {
                        rewrite ^(.*)$ index.php?q=$1 last;
                }

        }
        location ^~ /images/ {
                     if (!-e $request_filename){
                        rewrite ^(.*)$  imageserver/client.php?file=$1 last;
                }
        }
        location ~ .*\.(php|php5)?$
        {
                fastcgi_pass    127.0.0.1:9999;
                fastcgi_index   index.php;
                fastcgi_param  SCRIPT_FILENAME /xxx/www/domain.com/public/$fastcgi_script_name;
                include        fastcgi_params;
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
                expires         120d;
        }
        location ~ .*\.(js|css)?$
        {
                expires 1h;
        }

}


[火星人 ] nginx 不能讀取圖片。萬般無奈來求助已經有1269次圍觀

http://coctec.com/docs/service/show-post-2235.html