Jump to content
TNG Community
bettis

solved: $tngdomain not used if language is changed

Recommended Posts

bettis

Hi there,

I am trying to set up TNG12.2 the following way:

TNG is served by NGINX running in a Docker container on a server in my intranet. Access from internet is redirected via a ReverseProxy (traefik). Therefore I have added my external domain in config.php:

$rootpath = "/config/www/";
$templatenum = "11";
$templateswitching = "1";
$homepage = "index.php";
$tngdomain = "https://genealogy.roeckies.selfhost.bz/";
$sitename = "";
$site_desc = "";
$tngconfig['doctype'] = "";
$target = "_self";
$language = "German-UTF8";
$charset = "UTF-8";

Everything works fine as long as I use the same language (default is German, but I have also configured English). When I change the language, then the browser shows the page address not to being in the $tngdomain genealogy.roeckies.selfhost.bz, but in my local intranet URL http://192.168.1.1:8080/. This works as long as I access it from my intranet, but from internet this address of course can not be found.

You should be able to see this behaviour even without logging in, just by opening the start page at https://genealogy.roeckies.selfhost.bz/ and changing the language.

I have no idea what I have missed.

Any help is appreciated,

Markus

Share this post


Link to post
Share on other sites
theKiwi

I have no idea what is going on - when I try to change it to English it's trying to load this page

http://192.168.178.53:8088

So quite different from what it's trying to load for you.

But I have no idea where it might be getting that from - it's not in the cookies that your TNG site sets. 

Maybe you will need to write to Darrin about this?

Roger

Share this post


Link to post
Share on other sites
bettis

Hi Roger,

sorry, I tried to figure out what is happening by changing some bits in my network/nginx/traefik settings and also moved TNG to a different container, that is now running in my intranet on http://192.168.178.53:8088, not http://192.168.1.1:8080/ anymore as written above. But nothing solved this problem.

So the problem is still the same: When changing the language TNG delivers the internal URL instead of the one defined in $tngdomain, while for all other links/buttons it works as expected.

Markus

Share this post


Link to post
Share on other sites
bettis

Hi all,

Darrin helped me to find out the reason for my problem:

I did not set the server_name in nginx config to my virtual domain name, so $_SERVER['HTTP_HOST'] returned the local server name.

Now it works like charm.

Markus

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×