VESTA CP and F3 -> nginx configuration

827 views
Skip to first unread message

Caspar

unread,
Jul 10, 2014, 2:30:33 PM7/10/14
to f3-fra...@googlegroups.com
Dear community
Has someone of you installed a f3 application on a vesta control pannel vps?
I have troubles with the nginx config ... it will not accept the "Sample Nginx Configuration" as stated on https://github.com/bcosca/fatfree.
It throws an 500 Error... any help? any advice?
Thank you

Matthew Fletcher

unread,
Nov 12, 2014, 12:24:32 PM11/12/14
to f3-fra...@googlegroups.com
I have the same problem, did you find out the correct way to set this up?

Sascha

unread,
Nov 12, 2014, 12:26:53 PM11/12/14
to f3-fra...@googlegroups.com
Have you checked the server's error log? Error 500 could be ANYTHING.

Matthew Fletcher

unread,
Nov 12, 2014, 12:39:25 PM11/12/14
to f3-fra...@googlegroups.com
Actually I'm getting a 404:

Not Found

The requested URL /index.php was not found on this server.

For reference, Vesta CP is an open source hosting control panel which uses both nginx and apache as its webservers. Static content is handled by nginx, any else is passed on to apache as a proxy.

Here's an example of my nginx configuration, as comes out of the box from creating a new site in Vesta CP:

server {
    listen      31.123.123.123:80;
    server_name diary.example.co.uk ;
    error_log  /var/log/apache2/domains/diary.example.co.uk.error.log error;

    location / {
        proxy_pass      http://31.123.123.123:8080;
        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|mkv|mov|mp4|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {
            root           /home/matt/web/diary.example.co.uk/public_html;
            access_log     /var/log/apache2/domains/diary.example.co.uk.log combined;
            access_log     /var/log/apache2/domains/diary.example.co.uk.bytes bytes;
            expires        max;
            try_files      $uri @fallback;
        }
    }

    location /error/ {
        alias   /home/matt/web/diary.example.co.uk/document_errors/;
    }

    location @fallback {
        proxy_pass      http://31.123.123.123:8080;
    }

    location ~ /\.ht    {return 404;}
    location ~ /\.svn/  {return 404;}
    location ~ /\.git/  {return 404;}
    location ~ /\.hg/   {return 404;}
    location ~ /\.bzr/  {return 404;}

    include /home/matt/conf/web/nginx.diary.example.co.uk.conf*;
}

Sascha

unread,
Nov 12, 2014, 12:43:18 PM11/12/14
to f3-fra...@googlegroups.com
Don't access the "index.php" directly. F3 isn't using any file names at all. Just open "/" and re-check your server logs to look for the erorr 500 if it still exists.

Matthew Fletcher

unread,
Nov 13, 2014, 4:05:00 AM11/13/14
to f3-fra...@googlegroups.com
I'm not going to /index.php, I'm trying to load /matt

<?php

$f3=require('lib/base.php');

$f3->set('DEBUG',1);
if ((float)PCRE_VERSION<7.9)
        trigger_error('PCRE version is out of date');

$f3->config('config.ini');

$f3->route('GET /matt',
        function($f3) {
                echo "Hello World!";
        }
);

$f3->run();

ikkez

unread,
Nov 13, 2014, 4:37:43 AM11/13/14
to f3-fra...@googlegroups.com
try to the set root in your nginx config:

server {

 root
/var/www/html/fatfree/;

 
...

}
Reply all
Reply to author
Forward
0 new messages