Is /etc/nginx/sites-available the right location for subdomain settings on a YunoHost system?

Hi, thanks for the great work you’re doing here! I’ve been running YunoHost for a while and have run into a little trouble, and looked through the documentation and searched forum posts without being able to find an exact answer. I’d greatly appreciate it if anyone can give me some insight.

My YunoHost server

Hardware: VPS 4GB RAM, Debian 11
YunoHost version: 11.1.21.4 (stable).
I have access to my server : Through SSH & webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : yes
If yes, please explain: I’m trying to configure nginx settings for a proxy server that will serve external files to my Glitchsoc instance installed through YunoHost. As far as I can tell, the existing Redirect app cannot serve this need.

Description of my issue

What I am trying to achieve: Configure a proxy server for external files uploaded to object storage.

In what context: Want to move media files used by the Glitch-Soc app offsite because media is taking up too much space on the server.

What I tried: Put the proxy server configuration file media.krpgpub.net in /etc/nginx/sites-available and symlinked it from /etc/nginx/sites-enabled, then entered DNS records for the media subdomain as suggested by YunoHost and installed the Let’s Encrypt certificate through YunoHost. For reference, the nginx settings are identical to ones that are working on a different non-YunoHost server I run. Object storage on Mastodon with a Backblaze B2 bucket | Un-author-ized writer

What happens: Media are broken on the instance when I configure Glitch-Soc to use the proxy and remote object storage. Media files have been uploaded to the remote bucket and the (empty) media on the site, when inspected, show they are being fetched from the media.krpgpub.net proxy, so if the proxy is working correctly it should be serving media files from the remote bucket to the instance. (Object storage settings are currently turned off on the instance because turning them on breaks media)

The missing piece in this is the proxy file server configuration itself, which I have gone over several times and appears to be correct. I am wondering if YunoHost set the nginx configuration location different than the default system, making Glitch-Soc unable to use the nginx settings I added, or if I can rule out that possibility and the configuration itself needs more work.

Also the media.krpgpub.net proxy server, when I visit it, redirects to the Yunohost page on the server and I am unsure if this is what it is supposed to do. On my other server where I have object storage running, the file proxy subdomain gets a 403 Forbidden error on the browser. https://fileproxy.writeout.ink/

Since both nginx and the app are running after reload/restart, I have no error logs to report and would appreciate tips on how to get logs if necessary.

Ughh not sure to understand everything but clearly no, stuff don’t happen in /etc/nginx/sites-available … it happens in /etc/nginx/conf.d/the.domain.tld.conf (and the.domain.tld.d)

I don’t quite understand why you’d have to manually add the nginx configuration, you should be adding the domain to YunoHost and let it configure nginx and everything domain-related …

Huh thanks for that tip! I’ll be trying it and marking the post resolved if it works.

I did add the domain through YunoHost and get signed and stuff, but I don’t just need a subdomain, I need to configure it to point to the remote bucket and fetch files from there. If there’s a YunoHost app/function for that I’d be thrilled, obviously.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.