r/linuxadmin • • Dec 10 '25

Need help with reverse proxy chain + tailscale

Im not sure if this is even the subreddit to post this in, but i have issues regarding tailscale in combination with reverse proxy (nginx proxy manager).
Im not sure if what im doing here even should work to be honest and its a frankenstein solution at best i guess..

I have 3 servers, in this case one public(vps) and 2 local. Lets call them srv1, srv2 and srv3.

srv1 is the public facing one (public ip, domain with A-record) exposing services via nginx proxy manager(service.example.tld) and is in the tailscale network.

srv2 is the local one which acts as a bridge between the public server(srv1) and the local server with the actual service running(srv3) also via nginx proxy manager(using a subdomain to get a valid ssl cert via dns challenge: service.local.example.tld) and is also in the tailscale network with srv1.

srv3 is the local one which exposes the service also via nginx proxy manager, but with a self signed cert(service.invalid.tld). I have to do this since jellyfin which is the service im exposing doesnt let me use https without a reverse proxy anyway, and i have other stuff on this server that should never get exposed, hence the gateway-ish solution via srv2.

srv1 will not expose it directly but will be the only server accessible from the internet to get a vpn connection.

So the actual issue i have is i get a 502 error when srv1 gets hit with service.example.tld.
When i hit srv2(locally) with service.local.example.tld i can access it(tried proxy host: service.invalid.example and ip:port), also hitting srv3 with service.invalid.tld and ip:port works.

Tried troubleshooting with gemini after not finding a solution with google who suggested me to curl -v -k from srv1 but nothing helpful after and the output is this:

* Host service.local.example.tld:443 was resolved.

* IPv6: (none)

* IPv4: 1.2.3.4

* Trying 1.2.3.4:443...

* Connected to service.local.example.tld (1.2.3.4) port 443

* ALPN: curl offers h2,http/1.1

* TLSv1.3 (OUT), TLS handshake, Client hello (1):

* TLSv1.3 (IN), TLS handshake, Server hello (2):

* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):

* TLSv1.3 (IN), TLS handshake, Certificate (11):

* TLSv1.3 (IN), TLS handshake, CERT verify (15):

* TLSv1.3 (IN), TLS handshake, Finished (20):

* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):

* TLSv1.3 (OUT), TLS handshake, Finished (20):

* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / X25519 / id-ecPublicKey

* ALPN: server accepted http/1.1

* Server certificate:

* subject: CN=*.local.example.tld

* start date: Dec 8 0:0:0 2025 GMT

* expire date: Mar 8 0:0:0 2026 GMT

* issuer: C=US; O=Let's Encrypt; CN=E8

* SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.

* Certificate level 0: Public key type EC/secp384r1 (384/192 Bits/secBits), signed using ecdsa-with-SHA384

* Certificate level 1: Public key type EC/secp384r1 (384/192 Bits/secBits), signed using sha256WithRSAEncryption

* using HTTP/1.x

> GET / HTTP/1.1

> Host: service.local.example.tld

> User-Agent: curl/8.5.0

> Accept: */*

>

* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):

* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):

* old SSL session ID is stale, removing

< HTTP/1.1 302 Found

< Server: openresty

< Date: Wed, 10 Dec 2025 17:20:39 GMT

< Content-Length: 0

< Connection: keep-alive

< Location: web/

< Alt-Svc: h3=":443"; ma=86400

< X-XSS-Protection: 0

< X-Content-Type-Options: nosniff

< X-Frame-Options: SAMEORIGIN

< Content-Security-Policy: upgrade-insecure-requests

< Strict-Transport-Security: max-age=63072000; includeSubDomains; preload

<

* Connection #0 to host service.local.example.tld left intact

6 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/HotAdministration939 Dec 10 '25

this looks about right, it was in /data/nginx/proxy_host/4.conf

https://pastebin.com/CyBEUUH8