[core] Proxy socket: compile option proxy_socket gives both engines a 0660 Unix socket for the front proxy (edge in its config, Caddy a third server with trusted_proxies_unix); listeners change only with a restart
This commit is contained in:
@@ -60,10 +60,6 @@ pub struct Options {
|
||||
pub credentials_dir: Option<PathBuf>,
|
||||
/// The overall deadline for a request header; default [`deadline::HEADER_TIMEOUT`].
|
||||
pub header_timeout: Option<std::time::Duration>,
|
||||
/// A Unix socket (mode 0660) on which edge serves the HTTPS hosts in plain HTTP to a front
|
||||
/// proxy that terminated TLS (Caddy beside Ianitor). Only the socket's owner and group can
|
||||
/// connect, so its `X-Forwarded-For` is believed (Unix only).
|
||||
pub proxy_socket: Option<PathBuf>,
|
||||
}
|
||||
|
||||
impl Options {
|
||||
@@ -148,8 +144,8 @@ pub fn server(shared: Arc<Shared>, opts: &Options) -> Result<Server, EdgeError>
|
||||
https
|
||||
.endpoints()
|
||||
.set_pre_tls_callback(Arc::new(tls::HandshakeStart));
|
||||
if let Some(path) = &opts.proxy_socket {
|
||||
add_proxy_socket(&mut https, path)?;
|
||||
if let Some(path) = &rt.cfg.proxy_socket {
|
||||
add_proxy_socket(&mut https, Path::new(path))?;
|
||||
}
|
||||
|
||||
let mut http = Service::new(
|
||||
|
||||
Reference in New Issue
Block a user