Welcome! Log In Create A New Profile

Advanced

NGINX No input file specified woes.

Posted by ehime 
NGINX No input file specified woes.
March 03, 2011 11:56AM
I've been having issues getting my NGINX setup running on my Debian box for our dev server,
this thing just does not want to work. I had it showing an info page (<?php phpinfo(); ?>) from
our IP for about ten minutes, then something broke somewhere and am just getting 404 input
not found messages now.I have been completely unable to get the DNS to resolve for whatever
reason and am at my whits ends, I've been cranking away at this for the last two days and am
up to my eyes in time loss. All help is greatly appr.

nginx.conf:
user www-data;
worker_processes 1;

events {
worker_connections 2048;
use epoll;
}

http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 20;

gzip on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

log_format main
'$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx_access.log main;
error_log /var/log/nginx_error.log debug;
#include /usr/local/nginx/sites-enabled/*;
include /etc/nginx/vhosts/*;
}

sites.conf:
server {
root /var/www/html;

listen *:80;
server_name dev2.xxx.org;
location / {

index index.php;

# if file exists return it right away
if (-f $request_filename) {
break;
}

if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}

# otherwise rewrite the fucker
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php$1 last;
break;
}

}

# Process PHP files with fastcgi
location ~ \.php$ {
#if ( !-f $request_filename ) {
# return 404;
#}

include /etc/nginx/fastcgi_params;

fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;

# include /usr/local/nginx/conf/fastcgi_params;
fastcgi_ignore_client_abort on;
}


# if the request starts with our frontcontroller, pass it on to fastcgi
location ~ ^/index.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;

# include /usr/local/nginx/conf/fastcgi_params;
fastcgi_ignore_client_abort on;
}
}

Logs are kept in /usr/local/nginx/logs/ but are not updating
Re: NGINX No input file specified woes.
March 04, 2011 10:22AM
If you have basic trouble and not even logging is working, start with a simpler configuration and work your way up.

Here are some basic examples: http://blog.martinfjordvald.com/2010/07/nginx-primer/ , especially the "Handling PHP" part. Your rewriting can be abridged, see the next section, "SEF Friendly URLs".

By quickly looking at your config, I see the following problems:

- You have 2 PHP handlers which essentially do the same thing. The first one even has 2 "fastcgi_param SCRIPT_FILENAME"s, only do this once.

- Also read up on taxing rewrites here: http://wiki.nginx.org/Pitfalls

- listen *:80; is the defined by default, you don't need it
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 234
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready