|
@ -64,7 +64,9 @@ impl<'a> NginxServer<'a, String> { |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
pub fn new_redir(domain: &'a str, target: &'a str, command_runner: &'a CommandRunner) -> Self {
|
|
|
pub fn new_redir(domain: &'a str, target: &'a str, command_runner: &'a CommandRunner) -> Self {
|
|
|
let content = NginxServer::server_config(domain, &format!("return 302 $scheme://{}$request_uri;", target));
|
|
|
|
|
|
|
|
|
let content = NginxServer::server_config(domain, &format!("location / {{
|
|
|
|
|
|
return 301 $scheme://{}$request_uri;
|
|
|
|
|
|
}}", target));
|
|
|
NginxServer::new(domain, content, command_runner)
|
|
|
NginxServer::new(domain, content, command_runner)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|