How to bypass yunohost/admin accessing through direct public IP

Hello everyone.

(Update at the bottom)

I’m trying to make it so that when accessing my Yunohost domains through their public IP, it completely skips the /yunohost/admin page and there’s no way around it.

I have two domains mounted with a webpage each: “example1.duckdns.org” and “example.duckdns.org”, both of which are accessible and functioning correctly when accessed. I also have two additional domains, “standard1.com” and “standard2.com”, whose ANAME and CNAME point to *.duckdns.org, but the problem lies in that the .com domains directly link to the public IP, causing only the admin page to appear.

I’ve managed to get as far as modifying the file “/etc/nginx/conf.d/default.d/redirect_to_admin.conf” by changing it to (thanks to help of IA, by the way):

if (http_x_forwarded_proto = "http") { return 302 https://host$request_uri; }

However, what happens with this code (and any other options I’ve seen in the forum) is that despite removing $host/yunohost/admin;, I always end up with an unresolvable redirect error.

With this specific code, I’ve managed to skip the admin page, but it redirects me to a default installation page of Nginx instead.

I’ve tried all and every option I’ve come across on the forum except for installing an SSL certificate linked to the domains *.com (which I’ll try to fix tomorrow, if I can). I have even upgraded to the beta test 12 with no luck.

Could someone help me out? Many thanks!

P.S. Sorry for writing such a long post.

Update: I’ve more or less bypassed my problem creating two new domains in yunohost. I’ve created example1.com and example2.com, redirecting everything to them in yunohost configuration.

It works! The duckdns dinamic service is working and everithing is working, for the moment.

I still have to deal with SSL certificates that for the time being cannot register with let’s encrypt (I hate certificates and bureaucrazy).

I think it’s not the solution because is a bit messy but it’s a kind of solution.

Hi efcsn,

Welcome to the forums :slight_smile:

Great that you found a solution to your problem!

While reading (and still…) it’s not quite clear to me what the situation is, but my suggestion would have been in the same direction as your solution. The system will only answer to requests for domains that are actually managed by the system.

They should work more or less automatically. If it keeps being unable to get a certificate from Letsencrypt, consider opening a new thread!

I just wanted to do one redirecton to a dynamic DNS and then redirect to a “proper” domain but even though I didn’t have any problems with the dynamic DNS, the “official” domain redirected me to the direct IP and, because of how yunohost is configured, it detected it as admin access and that’s what I wanted to avoid, admin access through the direct IP.

The solution I found was simpler, and as you say, it’s the correct one. I’m still learning how all this web stuff works :wink:

1 Like

Have created one new domain in yunohost and wanted to install a noster service, how can i bypass the one new domain to not go to the “yuno admin page”?

How do i add that to my config? How does your config look like so can i try to do the same.

Since you have installed a protocol I really don’t know how to do that. I’m learning on the go.

What have you installed?

Did install Ditto/nostr service.