# New server, Same config, New error

**URL:** <https://www.ruby-forum.com/t/new-server-same-config-new-error/222106>\
**Category:** NGINX\
**Created:** [August 13, 2012, 2:58am UTC](https://www.ruby-forum.com/t/new-server-same-config-new-error/222106 "2012-08-13T02:58:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [August 13, 2012, 2:58am UTC](https://www.ruby-forum.com/t/new-server-same-config-new-error/222106/1 "2012-08-13T02:58:13Z")

</div>

Centos 6 with nginx and php using php-fpm.  
Exactly like my other server only, that one works.

No matter what I do, I get this: “File not found.”  
In the headers it shows it’s a 404.

I’ve googled now for hours, followed all the tutorials but still  
nothing.

# 

# The default server

# 

server {  
listen 80;  
server\_name \_;  
client\_max\_body\_size 500G;  
#charset koi8-r;

```
#access_log logs/host.access.log main;

location / {
  rewrite ^/dl/(.*)/(.*)/headers/$

```

/download.php?link=$1&filename=$2&headers=1 last;  
rewrite ^/dl/(._)/(._)$ /download.php?link=$1&filename=$2 last;  
root /usr/share/nginx/html;  
index index.html index.htm index.php;  
include conf.d/blockips.conf;  
}

```
error_page 404 /404.html;
location = /404.html {
    root /usr/share/nginx/html;
}

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
    root /usr/share/nginx/html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on

```

127.0.0.1:9000  
#  
location ~ .php$ {  
fastcgi\_split\_path\_info ^(.+.php)(.\*)$;  
fastcgi\_pass backend;  
root /usr/share/nginx/html;  
fastcgi\_index index.php;  
fastcgi\_param SCRIPT\_NAME $document\_root$fastcgi\_script\_name;  
fastcgi\_param SCRIPT\_FILENAME  
$document\_root$fastcgi\_script\_name;

```
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;

fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;

fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;

# PHP only, required if PHP was built with

```

–enable-force-cgi-redirect  
fastcgi\_param REDIRECT\_STATUS 200;  
fastcgi\_connect\_timeout 60;  
fastcgi\_send\_timeout 180;  
fastcgi\_read\_timeout 180;  
fastcgi\_buffer\_size 128k;  
fastcgi\_buffers 4 256k;  
fastcgi\_busy\_buffers\_size 256k;  
fastcgi\_temp\_file\_write\_size 256k;  
fastcgi\_intercept\_errors off;  
fastcgi\_ignore\_client\_abort off;  
expires max;  
break;  
}

```
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
    deny all;
}

```

}

upstream backend {  
server 127.0.0.1:9000;  
}

Posted at Nginx Forum:

> **[New server, Same config, New error](https://forum.nginx.org/read.php?2,229610,229610#msg-229610)**
>
> Centos 6 with nginx and php using php-fpm. Exactly like my other server only, that one works. No matter what I do, I get this: "File not found." In the headers it shows it's a 404. I've googled now for hours, followed all the tutorials but...
