Use case redirect app as reverse proxy

What type of hardware are you using: Raspberry Pi 3, 4+
What YunoHost version are you running: 12.1.15.1
What app is this about: redirect

Describe your issue

I have a working configuration with yunohost web admin, a nextcloud instance on my yunohost machine. Web admin and nextcloud are reachable from the internet side via ddns.
How do I configure the redirect app in yunohost so that I can access an additional server within my internal network that is running on a different machine than my Yunohost server?
I’d like to explain this with an example: Yunohost with nginx runs on a local machine with the IP address 192.168.0.100 and is accessible from the internet via port forwarding at https://ynh.addns.tld. A web server runs on machine 192.168.0.200, which shall be accessible from the internet via the link https://ynh.addns.tld/service2 without exposing additional ports in my router.
I’ve set the type of this redirect app to “reverse proxy” and entered the local IP address of the machine running Service2 under Target, although I’m aware that this address cannot be resolved from the outside. What further tweaks do I need to make to /etc/nginx/conf.d/ynh.addns.tld.d/redirect.conf to make the redirect work as intended? Or do I have to make additional changes somewhere else?
Down below is the original content of /etc/nginx/conf.d/ynh.addns.tld.d/redirect.conf, created by yunohost:

Share relevant logs or error messages

rewrite ^/service2$ /service2/ permanent;
location /service2/ {

proxy_pass http://192.168.0.200;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Port $server_port;

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “upgrade”;

Include SSOWAT user panel.

include conf.d/yunohost_panel.conf.inc;
more_clear_input_headers ‘Accept-Encoding’;
}

Depending on the app, you may have to add the domain to the redirect app to the allowed domains. Or, some apps require that the proxy follows the same schema of the local path of the app.
If you can tell us what app is it, it will help us help you

As I said, it’s the redirect app for Yunohost: YunoHost app store | Redirect

I wasn’t talking about the redirect app but the app it is redirecting to

Oh, sorry, it’s just another web server, a dropbear instance, running on that other machine. And that machine is in the .local domain.

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