Welcome! Log In Create A New Profile

Advanced

nginx, alias, php-fpm = File not Found

Posted by deux 
nginx, alias, php-fpm = File not Found
January 06, 2014 02:27PM
Hello everyone, I'm trying to set up nginx with DAViCal.
However, I'm getting a "File not Found" with a "FastCGI sent in stderr: "Primary script unknown" in the log.
Looks like something is wrong with my aliasing but I sure can't figure it out.

My virtual host:
server {
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80 default_server ipv6only=on; ## listen for ipv6

root /var/www-data;
index index.html index.htm index.shtml index.php;

server_name that.random.server;

location / {
ssi on;
}

location ~ \.php$ {
#try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
}

location /calender {
alias /usr/share/davical/htdocs;
}
}

#############################################################

My FastCGI-params:
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 SCRIPT_FILENAME $request_filename;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
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;

fastcgi_param HTTPS $https;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;

###############################################################

I'd be really glad if someone would help me sort that out.

So long,
deux
Re: nginx, alias, php-fpm = File not Found
January 07, 2014 04:57AM
Hello
I'm experiencing some similar problems with some 404 errors for index.php file, one js and one image file... using joomla, but the website is working and the pages are compiled. I see this errors in the firebug.

I use Ispconfig.
Really not understand.

This is my configuration:

$document_root /var/www/mywebsite.com/web/

index index.php index.html index.htm default.html default.htm;

# deny running scripts inside writable directories
location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
return 403;
error_page 403 /403_error.html;
}

location / {
try_files $uri $uri/ /index.php?q=$request_uri;
}

location ~ .*.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:8998;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

# caching of files
location ~* \.(ico|pdf|flv)$ {
expires 1y;
}

location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt|otf|woff)$ {
expires 30d;
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 149
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready