MDeLuise / plant-it

🪴 Self-hosted, open source gardening companion app
https://plant-it.org
GNU General Public License v3.0
453 stars 17 forks source link

Document how to use reverse proxy with subpath URLs #213

Open nakal opened 3 weeks ago

nakal commented 3 weeks ago

Avoid duplicated bug reports

Description

I usually don't want to make a new DNS entry and certificates and just install my containers on my reverse proxy using URLs like https://my.homeserver.domain/webapplicationname.

I could not find how to do this. It's also very difficult to guess how to set up the reverse proxy entries. At no point there is a hint that the entries for Nginx should like similar to this:

        location / {
                proxy_pass http://internal-host:3000/;
                proxy_set_header Host      $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_http_version 1.1;
                auth_basic           "off";
        }

        location /api/ {
                proxy_pass http://internal-host:8080/api/;
                proxy_set_header Host      $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_http_version 1.1;
                auth_basic           "off";
        }

For subpath /plant-it it should probably look like:

        location /plant-it/ {
                proxy_pass http://internal-host:3000/;
                proxy_set_header Host      $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_http_version 1.1;
                auth_basic           "off";
        }

        location /plant-it/api/ {
                proxy_pass http://internal-host:8080/api/;
                proxy_set_header Host      $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_http_version 1.1;
                auth_basic           "off";
        }

But this does not work, because I cannot find out how to set up the server path. The "server URL" does not affect the subpath btw. The home webpage still delivers <base href="/">.

Local environment

  1. backend 0.7.1
  2. frontend 0.6.1
  3. installation via docker-compose