2014-07-04 58 views
3

我遇到了我的Nginx配置文件问题。当我加载phpMyAdmin时,一切正常 - 除非图像不会加载。Nginx + phpMyAdmin问题

检查错误日志,我发现所有对图像/其他静态内容的请求都在请求的末尾添加了“/index.php”。

如果有人能让我知道我做错了什么,我将不胜感激。

错误日志:

2014/07/03 20:17:32 [error] 75683#0: *61 "/local/www/phpMyAdmin/themes/original/img/ajax_clock_small.gif/index.php" is not found 
2014/07/03 20:17:33 [error] 75683#0: *59 "/local/www/phpMyAdmin/themes/original/jquery/jquery-ui-1.9.2.custom.css/index.php" is not found 
2014/07/03 20:17:33 [error] 75683#0: *61 "/local/www/phpMyAdmin/themes/original/img/logo_left.png/index.php" is not found 
2014/07/03 20:17:33 [error] 75683#0: *58 "/local/www/phpMyAdmin/themes/original/img/ajax_clock_small.gif/index.php" is not found 

Nginx的配置:

server { 

    listen XX.XX.XX.XXX:443; 

    ssl on; 
    ssl_certificate  /etc/ssl/cert/example.com/example.com.crt; 
    ssl_certificate_key /etc/ssl/cert/example.com/example.com.key; 

    server_name  example.com; 
    access_log  off; 
    error_log  /var/log/nginx/example_error.log; 

    root   /opt/www/example.com/httpdocs; 
    index   index.php index.html; 

    charset UTF-8; 

    try_files $uri $uri/ @backend; 

    location /phpmyadm/ { 
     alias    /local/www/phpMyAdmin/; 
    } 

    location ~* ^/phpmyadm/(.+\.(jpg|jpeg|gif|png|bmp|ico|pdf|flv|swf|html|htm|txt|css|js))$ { 
     alias    /local/www/phpMyAdmin/; 
     expires   365d; 
     etag    on; 
    } 

    # Pass off php requests to Apache 
    location ~* \.php { 
     include   /etc/nginx/proxypass.conf; 
     proxy_pass   http://127.0.0.1:80; 
    } 

    location @backend { 
     include   /etc/nginx/proxypass.conf; 
     proxy_pass   http://127.0.0.1:80; 
    } 
} 
+0

我有同样的资产,创建一个类似选址研究/ phpmyadmin_secure问题在这里。你最近有没有遇到过任何问题? – Dani

回答

1

PHP和像在这个例子中

#### PHPMYADMIN 
    location /phpmyadmin_secure { 
     index index.php; 
     location ~ ^/phpmyadmin_secure/(.+\.php)$ { 
       try_files $uri =404; 
       fastcgi_pass unix:/var/run/php5-fpm.sock; 
       fastcgi_index index.php; 
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
       include /etc/nginx/fastcgi_params; 
     } 
     location ~ \.(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { 
       root /usr/share/phpmyadmin; 
     } 
    } 
####