| Post Reply | RetroFed Forum Forum Index » Selfhosted |
| Author | Message | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
xavier666
lemmy.umucat.day
xavier666@lemmy.umucat.dayJoined: 2025-06-06 |
Hello all, I figured that a chunk of the selfhost community is using Caddy, so decided to post my query here. Some information
I have a couple of services running on a host, so I access them via Caddy's reverse proxy.
With this entry, I can access the login page. After some searching online and some LLM wrangling, I figured it's some cookie issue or my login page is expecting a certain host. What should I add to my Caddyfile so that the login redirect works? Edit1: Clarification! Everything is behind wireguard. Nothing is exposed to public (other than wireguard). I only access it within my home. The router login page cannot be accessed from outside. Edit2: After a discussion with a friend, I have slightly narrowed it down (maybe, I'm not sure) to a http/https issue. When I made this change, the login redirection works.
But this means that all communication is over HTTP. |
||||||||||||||||||
| 26 Original | |||||||||||||||||||
|
osanna
thebrainbin.org
osanna@thebrainbin.org Joined: 2026-02-01 |
I don't know, but I expect it's having an issue because i assume the port is forwarded from your router to your caddy, but then the caddy server it redirecting back to the router. I don't know how you'd get around this. but that might be a starting point for your research. ETA: Also, it's a bad idea to expose your consumer grade router to the internet. VERY bad idea. |
||||||||||||||||||
| 0 | |||||||||||||||||||
|
mrnobody
reddthat.com
mrnobody@reddthat.com Joined: 2026-01-08 |
Why are you exposing your router login to the open web?? No bueno! I take it you're hitting that page via browsing to your public IP or domain name you setup? I'm no expert but it sounds like you're using a self signed cert and using https to login to your router and it doesn't like that... |
||||||||||||||||||
| 2 | |||||||||||||||||||
|
lmr0x61
lemmy.ml
lmr0x61@lemmy.ml Joined: 2025-02-19 |
I have to echo what others have said, and tell you exposing your router’s login to the public internet is very risky (if you’re referring to the WiFi router in your home). I would strongly recommend some other solution to whatever broader problem you’re trying to solve with this—why do you need to access your router login from outside your home? Can the logging in (and presumably tinkering) be done at home? Definitely things to think through before proceeding. |
||||||||||||||||||
| 1 | |||||||||||||||||||
xavier666
lemmy.umucat.day
xavier666@lemmy.umucat.dayJoined: 2025-06-06 |
I don't know, but I expect it's having an issue because i assume the port is forwarded from your router to your caddy, but then the caddy server it redirecting back to the router. I don't know how you'd get around this. but that might be a starting point for your research. ETA: Also, it's a bad idea to expose your consumer grade router to the internet. VERY bad idea.
Nothing is exposed to public, other than my wireguard port. I'm running caddy internally. All DNS entries are local only. The router login page cannot be accessed from outside. |
||||||||||||||||||
| 2 | |||||||||||||||||||
|
osanna
thebrainbin.org
osanna@thebrainbin.org Joined: 2026-02-01 |
Nothing is exposed to public, other than my wireguard port. I'm running caddy internally. All DNS entries are local only. The router login page cannot be accessed from outside.
no worries. Just wanted to warn you in case you didn't know. :) |
||||||||||||||||||
| 2 | |||||||||||||||||||
iamthetot
piefed.ca
iamthetot@piefed.caJoined: 2026-01-08 |
I don't have anything to help you, other than to say you're probably onto it being something specific about your router wanting more info from the reverse proxy. I have an actiontec modem I proxy behind nginx proxy manager and it works fine without any additional configuration, though. What I really wanted to comment on was my surprise that everyone in a self hosting community assumed you were exposing that to the public when you absolutely did not say anything that implied it. Do none of you reverse proxy your local services? It's wonderful! Edited to add: actually, what cert are you using? I recently switched to a wildcard cert via DNS challenge from Let's Encrypt and everything has worked better since then. |
||||||||||||||||||
| 3 | |||||||||||||||||||
xavier666
lemmy.umucat.day
xavier666@lemmy.umucat.dayJoined: 2025-06-06 |
Why are you exposing your router login to the open web?? No bueno! I take it you're hitting that page via browsing to your public IP or domain name you setup? I'm no expert but it sounds like you're using a self signed cert and using https to login to your router and it doesn't like that...
I use wireguard when I'm outside. So I first turn wireguard and then access all my stuff.
Any way to trick my router login page? It's a TP-Link router |
||||||||||||||||||
| 2 | |||||||||||||||||||
xavier666
lemmy.umucat.day
xavier666@lemmy.umucat.dayJoined: 2025-06-06 |
I don't have anything to help you, other than to say you're probably onto it being something specific about your router wanting more info from the reverse proxy. I have an actiontec modem I proxy behind nginx proxy manager and it works fine without any additional configuration, though. What I really wanted to comment on was my surprise that everyone in a self hosting community assumed you were ...
Yes please! I don't want to type the port number when multiple services are running on the same server.
It's a self-signed local cert. I'm not using Let's Encrypt. Does it require a valid domain name to work? |
||||||||||||||||||
| 1 | |||||||||||||||||||
|
Decronym
Bot
Decronym@lemmy.decronym.xyz Joined: 2026-01-05 |
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
6 acronyms in this thread; the most compressed thread commented on today has 3 acronyms. [Thread #102 for this comm, first seen 18th Feb 2026, 14:11] |
||||||||||||||||||
| 1 | |||||||||||||||||||
iamthetot
piefed.ca
iamthetot@piefed.caJoined: 2026-01-08 |
Do none of you reverse proxy your local services? It’s wonderful! Yes please! I don't want to type the port number when multiple services are running on the same server. what cert are you using? It's a self-signed local cert. I'm not using Let's Encrypt. Does it require a valid domain name to work?
The setup I have does require a domain name, yes. I DNS challenge through cloudflare at the moment to get a wildcard cert for *.domain.tld and use that for my local services, including my modem, to serve with https. |
||||||||||||||||||
| 2 | |||||||||||||||||||
|
UnpledgedCatnapTipper
piefed.blahaj.zone
UnpledgedCatnapTipper@piefed.blahaj.zone Joined: 2025-08-13 |
Does accessing your router page via caddy work when you're actually on your home network and not accessing it via wireguard? Have you tried a different web browser to rule out your LLM suggested cookie issues entirely? |
||||||||||||||||||
| 1 | |||||||||||||||||||
xavier666
lemmy.umucat.day
xavier666@lemmy.umucat.dayJoined: 2025-06-06 |
Does accessing your router page via caddy work when you're actually on your home network and not accessing it via wireguard? Have you tried a different web browser to rule out your LLM suggested cookie issues entirely?
Unfortunately no, which rules out an issue with wireguard.
It's not the stale cookie issue which goes away when opening a website in incognito. I think it expects the cookie to have the original host information. Let me paste the list of issues the LLM mentioned. The following section is from the LLM
It has also mentioned some solutions for each cause. But I don't want to blindly apply them without knowing what is wrong. |
||||||||||||||||||
| 1 | |||||||||||||||||||
|
UnpledgedCatnapTipper
piefed.blahaj.zone
UnpledgedCatnapTipper@piefed.blahaj.zone Joined: 2025-08-13 |
Does accessing your router page via caddy work when you’re actually on your home network Unfortunately no, which rules out an issue with wireguard. Have you tried a different web browser to rule out your LLM suggested cookie issues It's not the stale cookie issue which goes away when opening a website in incognito. I think it expects the cookie to have the original host information. Let me past...
My best suggestion would be to try enabling web sockets and see if it changes anything. I did find a post for a similar issue that someone was having with a different reverse proxy, but I'm not sure if it'll be helpful. https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2099 |
||||||||||||||||||
| 1 | |||||||||||||||||||
|
a14o
feddit.org
a14o@feddit.org Joined: 2025-01-15 |
Seems like the router doesn't like how the headers are passed on. You could try:
https://caddyserver.com/docs/caddyfile/directives/reverse_proxy#headers |
||||||||||||||||||
| 5 | |||||||||||||||||||
irmadlad
lemmy.world
irmadlad@lemmy.worldJoined: 2025-03-24 |
Seems like the router doesn't like how the headers are passed on. You could try: login.router.lan { reverse_proxy 192.168.1.1:80 { header_up Host {upstream_hostport} } } https://caddyserver.com/docs/caddyfile/directives/reverse_proxy#headers
Semi related, you can check the validity of Caddy entries into the caddyfile:
Where |
||||||||||||||||||
| 2 | |||||||||||||||||||
xavier666
lemmy.umucat.day
xavier666@lemmy.umucat.dayJoined: 2025-06-06 |
Seems like the router doesn't like how the headers are passed on. You could try: login.router.lan { reverse_proxy 192.168.1.1:80 { header_up Host {upstream_hostport} } } https://caddyserver.com/docs/caddyfile/directives/reverse_proxy#headers
I have tried this, but unfortunately, it did not work. I have tried this suite of commands
Info: My caddy uses HTTPS but the router login page is HTTP. Not sure if this is relevant. |
||||||||||||||||||
| 1 | |||||||||||||||||||
|
surewhynotlem
lemmy.world
surewhynotlem@lemmy.world Joined: 2023-06-13 |
I don't know how to answer your question. But it might be that your router doesn't like being access as a url. I know I had to tell mine to accept login.router.net as itself. I also just want to highlight:
This means your credentials are being passed in plain text over your network between caddy and the router. This might be OK to you. But wanted to highlight for anyone else reading. |
||||||||||||||||||
| 1 | |||||||||||||||||||
xavier666
lemmy.umucat.day
xavier666@lemmy.umucat.dayJoined: 2025-06-06 |
I don't know how to answer your question. But it might be that your router doesn't like being access as a url. I know I had to tell mine to accept login.router.net as itself. I also just want to highlight: The router and the host running Caddy, are different machines This means your credentials are being passed in plain text over your network between caddy and the router. This might be OK to yo...
Hello there. I perfectly understand the risks of my setup. Since it's a commercial off-the-shelf router, i can't run a reverse proxy on it, so this is the best that i can do (other than VLANs). It's also a private network, so I guess it's fine. I used a bit of AI which said that such embedded devices don't work with reverse proxies. Finding which exact parameters as respected by the router will be time-consuming and the end result is not that great. |
||||||||||||||||||
| 2 | |||||||||||||||||||
| Post Reply |
Back to top |