0

zabbix-frontend を nginx で動作させようとしています。これは私のnginx confです:

server {

    listen 80;
    server_name localhost;
    root /var/www/test/htdocs;
    index index.php index.html index.htm;


    location /zabbix {

        alias                   /usr/share/zabbix;
        index                   index.php;
        error_page              403 404 502 503 504  /zabbix/index.php;

        location ~ \.php$ {
            if (!-f $request_filename) { return 404; }
            expires                 epoch;
            include                 /etc/nginx/fastcgi_params;
            fastcgi_index   index.php;
            fastcgi_pass    unix:/var/run/php5-fpm.sock;
        }

        location ~ \.(jpg|jpeg|gif|png|ico)$ {
            access_log      off;
            expires         33d;
        }

    }


    location / {
            try_files $uri $uri/ /index.php;
            include /etc/nginx/proxy_params;
    }

    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            fastcgi_read_timeout 120;
            include /etc/nginx/fastcgi_params;
    }

    include /etc/nginx/security;
    include /etc/nginx/main_rules;

}

/zabbixのphp スクリプトが機能しています。しかし、次のようなファイル/usr/share/zabbix/css.cssは提供されていません (404)。エラーログにはこれがあります:

2013/07/19 20:23:33 [error] 13583#0: *1 open() "/var/www/test/htdocs/zabbix/css.css" failed (2: No such file or directory), client: xxx, server: localhost, request: "GET /zabbix/css.css HTTP/1.1"

ご覧のとおり、nginx は/var/www/test/htdocs/エイリアス ディレクトリではなくメイン ルート ディレクトリでファイルを探しています/usr/share/zabbix/

なぜそうなのか、どうすれば修正できますか?

4

1 に答える 1

2

私はそれらの場所を分けようとします。エイリアスのみの /zabbix と fastcgi の ~ ^/zabbix/*.php$ 。ルートを持つ / の場所の外側の両方。

于 2013-07-20T08:48:46.707 に答える