Je viens de configurer mon serveur avec plusieurs applications et je rencontre des soucis de redirections. Voilà la situation avant le “bug”
ndd.tld > renvoie vers interface admin
www.ndd.tld > renvoie vers interface admin
wiki.ndd.tld > renvoi vers dokuwiki
rss.ndd.tld > renvoi vers ttrss
cette situation ne conveniat pas car je souhaitais plutot avoir un résultat qui ressemble à ça
ndd.tld > renvoie vers wiki
www.ndd.tld > renvoie vers wiki
wiki.ndd.tld > renvoi vers dokuwiki
rss.ndd.tld > renvoi vers ttrss
j’ai donc utiliser l’application redirect_ynh et mis en place 2 redirections
ndd.tld > wiki.ndd.tld (1)
www.ndd.tld > wiki.ndd.tld (2)
la redirection (2) a bien fonctionné, par contre la (1) me pose des soucis car je perds l’accès à l’interface user (l’interface admin fonctionne bizarrement) et aux sous-domaines
en gros voilà ma situation
ndd.tld > wiki.ndd.tld et plus accès interface user
www.ndd.tld > wiki.ndd.tld (ok)
wiki.ndd.tld > renvoi vers dokuwiki (ok)
rss.ndd.tld > wiki.ndd.tld (nok)
Comment résoudre ce problème ?
Je pense supprimer tout d’abord la redirection (1)
Par contre, je ne sais pas comment contourner le problème ? des idées ?
Salut
Dans ynh tu as un “domaine principal” qui gère le portail utilisateur. On dirait ndd.tld chez toi. Or, si sur ndd.tld tu fais une redirection 301/302 permanente, je pense qu’il ne trouve plus le portail.
Une solution serait de changer dans l’interface admin ou la console le domain ee principal en wiki.ndd.tld
Ou sinon de faire des redirections proxy si ton wiki le permet (ou bien en dur tu peux juste copier coller a peu près le nginx de dokuwiki)
That is why, I created 2 redirection with redirect_ynh
ndd.tld > wiki.ndd.tld (1)
www.ndd.tld > wiki.ndd.tld (2)
The (2) works well whereas (1) makes problem.
I could not connect to the user interface
I could not access ttrss and other applications
@scith found out why it was not working. The reason was that ndd.tld was set as the default domain.
That is why, I created a new sub-domain admin.ndd.tld and set it as the default domain. Now, I note that :
I can access to the user interface
sso does not work well (not working with nextcloud, dokuwiki; ok with ttrss)
when I try to look at my mail (user@ndd.tld) with thunderbird, I have an error because of a certificat problem (all my domain/sub-domain are well configured with let’s encrypt)
Perhaps another idea, although it may be more like a “hack”…
Install the redirect on ndd.TLD not on the root but in a path like ndd.TLD/wiki
In the admin interface, set the default application for ndd.TLD as the wiki redirect.
Now, when users go to ndd.TLD, they will be redirected to ndd.TLD/wiki and then wiki.ndd.TLD automatically.
However, your ndd.TLD will remain intact for the SSO, the mail or other stuff.
This won’t solve the root of the issue, but it may solve your specific problems for now…
@kanhu, I think I can do what you suggest. What bothers me is that I am not sure to be able to modify those files myself the day I decide to change something on my server…
Before following your advice, I would like to ask one question.
Is it possible to configure the redirection in order to redirect ndd.tld and www.ndd.tld to the wiki but to keep ndd.tld/www.ndd.tld shown in the browser url (I hope you can understand what I mean)
No it is not. Redirection itself means taking you other address. What do you want to do is alias address, which is app based like in nextcloud you can define two domain presenting same nextcloud instances. This is not Yunohost limitation.
But still you can try it through nginx configuration, some apps might work. My typical example is Zeronet. I have two domain for it. One for normal internet other for TOR.
You will have to copy the nginx configuration of /etc/nginx/config.d/wiki.ndd.tld.d/dokuwiki.config to /etc/nginx/config.d/www.ndd.tld.d/dokuwiki.config and /etc/nginx/config.d/ndd.tld.d/dokuwiki.config. Then restart nginx. This may work if Dokuwiki is ok with the alias address.
I disagree. It is possible by using the “proxy” setting in redirect_ynh.
But that wouldn’t be optimal.
The best would be to replace the nginx file with the exact same nginx used for wiki.ndd.TLD.
This way, both domains will behave the same.
This is supposing that the wiki accepts such behavior, which is perhaps @Kahnu point?