Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Error "An application error occurred. Please try again." on nginx #211

Open
jpsim opened this Issue Jun 29, 2012 · 8 comments

Comments

Projects
None yet
8 participants

jpsim commented Jun 29, 2012

From the initial install screen, I'm getting error "An application error occurred. Please try again."

Running Ubuntu 10.04.4, PHP 5.3.14-1, nginx 0.7.65.

All boxes on Install are green except Apache (optional).

My error.log looks like this:

2012/06/29 18:04:17 [error] 1430#0: *22 open() "/srv/www/vbx.example.com/public_html/index.php/install" failed (20: Not a directory), client: 206.248.139.39, server: vbx.example.com, request: "GET /index.php/install HTTP/1.1", host: "vbx.example.com"

Firebug shows me this:

GET http://vbx.example.com/support/rewrite/index.php
404 Not Found
41ms
?g=installjs (line 16)

POST http://vbx.example.com/index.php/index.php/install/validate
404 Not Found
43ms
?g=installjs (line 16)

My nginx config file looks like this:

server {
    listen   80;
    server_name vbx.example.com;
    access_log /srv/www/vbx.example.com/logs/access.log;
    error_log /srv/www/vbx.example.com/logs/error.log;

    location / {
        root   /srv/www/vbx.example.com/public_html;
        index  index.php;

        if (-f $request_filename) {
           break;
        }

        if (-d $request_filename) {
           break;
        }
        rewrite  ^(.*)$  /index.php?vbxsite=$1  last;
    }

    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        proxy_pass_header Set-Cookie;
        fastcgi_pass_header Set-Cookie;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param  SCRIPT_FILENAME /srv/www/vbx.example.com/public_html/$fastcgi_script_name;
    }
}

It seems to be an nginx rewrite issue but I can't decipher any more than that. Anyone have any ideas?

Thanks!

Owner

Gipetto commented Jul 2, 2012

jpsim,

I've been playing around with this and the issue might be requests for favicons & robots.txt being routed to OpenVBX.

Try adding this to your nginx config:

location /(favicon.ico|robots.txt) {
    access_log off; 
    log_not_found off;
    error_page 404 /404;
    expires   30d;
    add_header Cache-Control public;
}

bjtitus commented Jul 22, 2012

I was able to get through the install process by changing the OpenVBX.home variable to the proper address (it was showing up as http://myserveraddress.com/index.php/index.php)

Now I can't login. It continues to log me out and with @Gipetto's new config attempts gives me a 404 with the auth/login?redirect url. I've tried using all of the nginx config files I can find. I'm going to try digging into this a little deeper later.

klearvue commented Sep 1, 2012

Changing OpenVBX.home to actual URI allowed me to complete install and I am able to log in and use OpenVBX normally. Thanks for the hint, bjtitus!

Just in case someone else finds this thread, I found that if I changed the config.php file, specifically this line $config['index_page'] = 'index.php'; to$config['index_page'] = ''; My issue was solved. This is because the rewrite was already setup. If you have index.php in that config entry it will duplicate it on the OpenVBX.home variable in JS.

add this to your php block...

fastcgi_split_path_info ^(.+.php)(.+)$;

fastcgi_param PATH_INFO $fastcgi_path_info;

ringe commented Sep 30, 2013

@davismwfl Thank you, that worked for me too.

/OpenVBX/config/config.php

$config['index_page'] = '';

Nginx server:

Put the following directly ABOVE php directive.

Example:

location / {
    index  index.php;   
    if (!-e $request_filename){
    rewrite ^/(.*) /index.php?vbxsite=$1;
    }
}

location ~ \.php$ {
#do typical php-fpm stuff

}

htaccess to nginx converter
http://winginx.com/en/htaccess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment