Nginx and kirby into subdir

Hello, everyone!

I have trouble with kirby and nginx. My kirby files is into /kirbyurl subdirectory.
I can’t to create user. When i access my /kirbyurl/panel/ folder, i see form to create user, then i fill all areas, i press “create your account” and after that - nothing, same form with blank areas. Nothing also in error log. Tried with 777 to all folders - nothing, same result.
I assume problem is in my nginx rewrite config. Please, point me where is my error.

Here is my nginx config for kirby subdir:

location /kirbyurl {
	root /home/kirby/;
	index index.php;
	
    location ~ ^/kirbyurl/content/(.*).(txt|md|mdown)$ {
    rewrite ^/kirbyurl/content/(.*).(txt|md|mdown)$ /error redirect;
        }
        
        location ~ ^/kirbyurl/site/(.*)$ {
        rewrite ^/kirbyurl/site/(.*)$ /error redirect;
        }
        
        location ~ ^/kirbyurl/kirby/(.*)$ {
        rewrite ^/kirbyurl/kirby/(.*)$ /error redirect;
        }
        
    location /kirbyurl {
    try_files $uri $uri/ /kirbyurl/index.php?$uri&$args;
	    }
                                                
	    location /kirbyurl/panel {
        try_files $uri $uri/ /kirbyurl/panel/index.php?$uri&$args;
        }
              
        location ~ /\.ht {
        deny all;
        }                                                                        


	location ~ \.php$ {
		try_files $uri $uri/ /index.php?$args ;
		fastcgi_split_path_info ^(.+\.php)(.+)$;
	        include fastcgi_params;
	        fastcgi_index index.php;
	        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
	        fastcgi_pass 127.0.0.1:9000;
	        fastcgi_intercept_errors on;
    	}
    	
}

While I’m no familiar with Nginx, I’d say the rewriting works OK; since you can actually get to the Panel login form. You might want to check out this thread and the link in. the last post: Nginx and Panel configuration problem

Tried to catch error with c::set(‘debug’, true); - same situation, form just reloads and nothing happens :confused:

Not even anything in the error logs?

Nothing, clear log… Loke in post, that You showed - “No error message being thrown anywher”

I think the correct way to solve this would be to set the session_save_path in the php.ini file, see also this post: Panel install gives session problem (setting it in the toolkit seems to work but is a hack)

Tried with php_value[session.save_path] = /home/kirby/tmp in php-fpm.d/www.conf = same result. :frowning:

Hm, but is that your temp dir?

Have you tried (in a template)?

echo sys_get_temp_dir();

Then in your php.ini, set the path accordingly.

if i put test.php with <?php echo sys_get_temp_dir(); ?> into /home/kirby i see output “/tmp”. Maybe it shows php_value[session.save_path] = /home/kirby/tmp path?

P.S even i change path to /tmp, not /home/kirby/tmp - same result as in my first message - i see Create your first account form, after i press “create your account”, same form appears. I see session files, for an example in /var/lib/php/session, or in /home/kirby/tmp (depends on php_value[session.save_path] in php-fpm.d/www.conf file)

:frowning: Maybe someone can help me?

“Nice” support, for what i paid - dunno… :thinking:

I’m sorry that I couldn’t help you, as I said, my nginx experience is almost zero.

Maybe @bastianallgeier or @lukasbestle can help out with this?

If you have a Pro license, you can also contact Bastian directly.

This doesn’t look like an issue that is specifically related to Nginx. From the current information I can’t tell what the issue is, this will need further debugging.

As @texnixe wrote, you can contact Bastian directly at support@getkirby.com if you have a Pro license. He can help you debug this.