Kirby Panel w/ reverse Proxy

Hi,

I am trying to get my the panel up and running for a while now without success:
We are hosting the Kirby installation on a Synology NAS Box in our local network (192.168.0.5). The Synology host is running on Port 7004.

The domain we run the Kirby site on is http://view.mxr.at.
When a request for http://view.mxr.at (:80) hits our external IP, NAT on our router forwards the request to a MacMini Server (192.168.0.2) running a DNS server.
This DNS server has a setting for the alias http://view.mxr.at to reverse proxy it to the Synology NAS box on port 7004:

<VirtualHost 192.168.0.2:80>
	ServerName view.mxr.at:80
	ServerAdmin admin@example.com
	DocumentRoot "/Library/WebServer/Documents"
	DirectoryIndex index.html index.php
	CustomLog "/var/log/apache2/access_log" "%h %l %u %t \"%r\" %>s %b"
	ErrorDocument 404 /error.html
	<IfModule mod_ssl.c>
		SSLEngine Off
		SSLCipherSuite "ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM"
		SSLProtocol -ALL +SSLv3 +TLSv1
		SSLProxyProtocol -ALL +SSLv3 +TLSv1
	</IfModule>
	<IfModule mod_dav.c>
		DAVLockDB "/var/run/davlocks/.davlock100"
		DAVMinTimeout 600
	</IfModule>
	<IfModule mod_mem_cache.c>
		CacheEnable mem /
		MCacheSize 4096
	</IfModule>
	<Directory "/Library/WebServer/Documents">
		Options All +MultiViews -ExecCGI -Indexes -Includes
		AllowOverride None
		<IfModule mod_dav.c>
			DAV Off
		</IfModule>
	</Directory>
	<IfModule mod_proxy_balancer.c>
		ProxyPass / balancer://balancer-group/
		ProxyPassReverse / balancer://balancer-group/
		<Proxy "balancer://balancer-group">
			BalancerMember http://192.168.0.5:7004/client/ loadfactor=4
		</Proxy>
	</IfModule>
	<IfModule mod_alias.c>
		Alias "/collaboration" "/usr/share/collaboration"
		Alias "/icons/" "/usr/share/httpd/icons/"
		Alias "/error/" "/usr/share/httpd/error/"
	</IfModule>

To make the site work on http://view.mxr.at we have configured the site.php as following:

<?php
$kirby = kirby();
$kirby->urls->index = 'http://view.mxr.at';

Everything is working fine, only the panel doesn’t work: The page could not be found
http://view.mxr.at/panel/login

I asked a bunch of people and professionals for help but so far nobody could give me a hint. Maybe here someone has a clue?

Best,
Chris

My idea:

Like Changing the thumbs folder I think you have to add another line:

The thumbs folder can be moved as well, but the URL must be adjusted
accordingly to make sure that thumbnails will be loaded correctly.

<?php
$kirby = kirby();
$kirby->roots->index = ???
$kirby->urls->index = 'http://view.mxr.at';

But I don’t know, what you have to write for “???”.

Good luck!

Hm, I don’t know if this will do the trick… I just checked this:

<? echo server::get('server_name'); ?>

Which returns 192.168.0.5. I think this is the problem,…

Yep, the server name setup should normally fix the issue without additional adjustments.

But how do I fix it? Can I set the server name somehow?

Got it working!

I created another virtual host on the Synology box with a different port (:7005) with a proper name (in my case view.mxr.at) and reversed proxied to this one.

Everything is working fine, life is beautiful!

1 Like