im trying zabbix-frontend work nginx. here 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; } the php scripts in /zabbix working! files /usr/share/zabbix/css.css not being served (404). in error log this:
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" so can see, nginx looking file in main root directory /var/www/test/htdocs/ instead of in alias directory /usr/share/zabbix/.
why , how can fix that?
i try separate them locations. /zabbix alias , ~ ^/zabbix/*.php$ fastcgi. both outside / location root.
Comments
Post a Comment