This category is for general issues(=something is broken) regarding YunoHost, NOT apps.
on
This form is written in English but feel free to write in French if you’re more comfortable!
on
What type of hardware are you using
Virtual machine
What YunoHost version are you running
12.1.1
How are you able to access your server
The webadmin
SSH
Describe your issue
I would like unknown URL paths to return HTTP 404 instead of redirecting visitors to the YunoHost SSO login page.
My versions:
YunoHost: 12.1.41.2 (stable)
SSOwat: 12.1.1
For example, visiting https://www.example.org/wetwe redirects to the SSO portal, although /wetwe does not belong to any installed application. This also happens when accessing the domain from my LAN.
Expected behaviour:
Unknown paths outside configured application routes should return HTTP 404.
Protected applications should still redirect unauthenticated users to SSO.
The domain root should continue opening its configured default application.
The SSO portal should remain accessible through its explicit URL.
I have already disabled the default redirects for access by IP address or an unknown hostname. That works, but does not affect unknown paths on a configured domain.
Is there a supported way to achieve this without modifying SSOwat code, disabling application access controls, or manually maintaining a list of application paths?
If not, could a per-domain option be added and preserved during configuration regeneration and updates?
I found a previous discussion, but it is closed:
Share relevant logs or error messages
No failed YunoHost operation or associated Yunopaste log is involved. The issue is an HTTP redirect: requesting https://www.example.org/wetwe redirects to the SSO login page instead of returning HTTP 404.
I can provide relevant Nginx access logs or configuration excerpts if needed.
Hm, doesn’t the second replacement (/yunohost not access_by_lua_file but 404) not also make your login competely unavailable?
I’m wondering why I’m currently not able to see non-existing paths to redirect to the ynh login.
What app are you referring to?
The my_webapp_ynh seems to generate 404 with try_files $uri $uri/ /index.php?$args =404;
I checked: the second replacement only affects location /yunohost inside the HTTPS default_server block in yunohost_admin.conf. The login page on my configured domain still works, and I verified that it displays correctly without a proxy.
I’m not referring to a missing page inside a particular app. My apps are installed under subpaths such as /bludit/, /grav/ and /nextcloud/. I deliberately requested an unrelated path, https://example.org/wetwe, outside those app paths.
That request returns HTTP 302 to /yunohost/sso?r=…, whereas I would like it to return 404. The domain root should still redirect to the configured default app, and protected apps should retain their normal SSO authentication.
So your webapp_ynh example seems to cover a different case: a missing resource within a path handled by an app.