nginx vhost location parameters

Rich asked:

I just transfered a website to a new server; here is my sites conf (vhost) in nginx and the last 2 entries from error.log .

The images are not displaying when the index.php loads.

regars,


server {

    listen   80; ## listen for ipv4
    listen   [::]:80 default ipv6only=on; ## listen for ipv6

    server_name  maissane;

    access_log  /var/log/nginx/localhost.access.log;

    root   /var/www/alex.site.com;
    location / {
            index  index.html index.htm;
    }

    location ~ .php$ {
    fastcgi_pass 127.0.0.1:9090;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
    }

}

____log errors:

2013/03/02 16:01:51 [error] 16637#0: *35 open() “/var/www/alex.site.com/images/right_<” failed (2: No such file or directory), client: 65.94.70.3, server: alex, request: “GET /images/right_%3C?=%20$theme;%20?%3E.jpg HTTP/1.1”, host: “alex.site.com”, referrer: “http://alex.site.com/index.php?p=bio

2013/03/02 16:01:51 [error] 16637#0: *35 open() “/var/www/alex.site.com/favicon.ico” failed (2: No such file or directory), client: 65.94.70.3, server: alex, request: “GET /favicon.ico HTTP/1.1”, host: “alex.site.com”

My answer:


The log entry makes it pretty obvious.

You don’t actually have a file /images/right<?= $theme; =?>.jpg.

Try providing a filename that exists.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.