Unknown location and Internal Server Error

62 views
Skip to first unread message

John Lirac

unread,
Oct 17, 2022, 1:24:26 AM10/17/22
to Fusio
Hi! Copying and pasting this url https://demo.fusio-project.org/apps/fusio/route to a new google chrome tab should redirect me to the login page either you are logged or not. This is similar to right clicking the menus and opening them in new tab, chrome should redirect me to the fusio app login page. However, my setup does not redirect me to the login page. It results in an error


error.png

Anyone experiencing the same? thank you.

John Lirac

unread,
Oct 18, 2022, 6:34:49 AM10/18/22
to Fusio
I am thinking a redirect to login page in the conf is the solution. Should we be tweaking the     
location / {
    try_files $uri $uri/ /index.php$is_args$args;

in the sites-available/fusio file?

Christoph Kappestein

unread,
Oct 18, 2022, 3:24:18 PM10/18/22
to Fusio
Hi,

ok, so if I use the url https://demo.fusio-project.org/apps/fusio/route it works as expected, I get redirected to the login page. The error which you posted looks like the requests gets redirected to Fusio and not the apps folder,
in our default .htaccess we have an extra rule to exclude the apps folder s.

RewriteCond %{REQUEST_URI} !^/apps/

best regards
Christoph
Message has been deleted

John Lirac

unread,
Oct 18, 2022, 9:41:29 PM10/18/22
to Fusio
Hi checking the .htaccess files seems like all is correctly configured though. here are the setup:

/var/www/fusio/html/public

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/apps/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php/$1 [L]

RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]


for /var/www/fusio/html/public/apps/fusio

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(?!.*\.).*$ index.html [NC,L]

Am I missing something? Thank you.

Christoph Kappestein

unread,
Oct 19, 2022, 1:36:14 PM10/19/22
to Fusio
Hi,

ok, since you have posted above something with "try_files" I have assumed that you are using Nginx as web server, the .htaccess files work only if you are using an Apache,
but I`am sure this can be also configured at Nginx but it does not work directly out of the box.

best regards
Christoph

John Lirac

unread,
Oct 19, 2022, 11:03:18 PM10/19/22
to Fusio
Thanks for the reply Christoph. Been trying to figure this out for days now so it could be the VM or server configs and all. Fusio had been installed in another nginx server just to see if it will work following the installation documentation using NGINX. However, it resulted the same. SImply copying and pasting the https://site/apps/fusio/login resulted in the same error. I followed the step by step instruction in the documentation guide for nginx except for the php version as I am using 8.1php version. I wonder if there's a step missing or anyone tried installing fusio in NGINX using instructions from the documentation and run it smoothly? Please advise. Perhaps, there's a config setup missing?

As for the htaccess. I am not sure if this will be the equivalent for the nginx config:

location ~ /apps/ {
}

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


location ~ ^(.*)$ { }

location / {
  rewrite ^/(?!.*\.).*$ /index.html break;
}

John Lirac

unread,
Oct 20, 2022, 8:20:11 PM10/20/22
to Fusio
Starting to lose hope on this. Would be a shame if this is only caused by nginx configuration. Anyone tried a fresh install on nginx and made this work? I've had set this up into 3 machines and same errors. 

Christoph Kappestein

unread,
Oct 22, 2022, 4:02:17 PM10/22/22
to Fusio
Hi,

ok, so the error means, that the request to "/apps/fusio/login" gets routed to Fusio and Fusio tells that it does not know the route. So I think it is indeed related to the Nginx config, you would need to tell Nginx, that all calls to /apps should be not routed to Fusio but instead to the files located in the apps/ folder.

You could try to use the config, I have not tested it, but it should be enough s.


location ~ /apps/ {
}

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

best regards
Christoph

John Lirac

unread,
Oct 23, 2022, 8:54:03 PM10/23/22
to Fusio
Using the following config and added the  above code does not work. It won't let me log in the fusio app using the user credentials.

server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
    root /var/www/fusio/html/public;
    index index.html index.htm index.nginx-debian.html index.php;
    server_name demo.fusio-project.org;

    ssl_password_file /etc/ssl/test.pass;
        ssl_certificate /etc/ssl/bundle.crt;
        ssl_certificate_key /etc/ssl/privatekey.key;
     
    #location / {
    # try_files $uri $uri/ /index.php$is_args$args;
    #}

    location ~ \.php$ {
      include snippets/fastcgi-php.conf;
          fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
   
      fastcgi_split_path_info ^(.+\.php)(/.*)$;
          include fastcgi_params;
          fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
         fastcgi_param DOCUMENT_ROOT $realpath_root;

    }

       location ~ /apps/ {
    }

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

    error_log /var/log/nginx/fusio_error.log;
    access_log /var/log/nginx/fusio_access.log;
}

John Lirac

unread,
Oct 24, 2022, 7:49:25 PM10/24/22
to Fusio
Likewise, using the above config also does not display the developer's portal "Overview" page. Anyone be kind enough to share a working nginx config for fusio? Thank you.
Reply all
Reply to author
Forward
0 new messages