Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to corectly redirect a domain/subdomain and generate a certificate? #271

Open
nitanmarcel opened this issue Nov 20, 2024 · 1 comment

Comments

@nitanmarcel
Copy link

nitanmarcel commented Nov 20, 2024

How to corectly redirect a domain/subdomain and generate a certificate?

This is my caddy file, but as soon as I make my request to my url, caddy takes over the request and layer4 isn't able to detect it.

Looking trough the issues, the line that causes this issue, is the exact one I need to automatically generate the certificate seems to be the same config that causes

git.marcelsoftware.dev {
	tls [email protected] {
		on_demand
	}
}
{
	debug
	acme_dns cloudflare 1234 
	dynamic_dns {
		provider cloudflare 1234
		domains {
			marcelsoftware.dev @ www
		}
		dynamic_domains
	}
	layer4 {
		0.0.0.0:587 {
			route {
				proxy localhost:1507
			}
		}
		0.0.0.0:993 {
			route {
				proxy localhost:1903
			}
		}
		0.0.0.0:6612 {
			route {
				proxy localhost:6611
			}
		}

		:443 {
			@secure tls sni git.marcelsoftware.dev
			route @secure {
				proxy :6610
			}
			@ssh ssh
			route @ssh {
				proxy :6611
			}
		}
	}
}

git.marcelsoftware.dev {
	tls [email protected] {
		on_demand
	}
}
@nitanmarcel
Copy link
Author

Oh, I can use both caddy file and l4, one for http and one for ssh listening on port 22.

But I'm still curious about the ssl certificate thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant