This commit is contained in:
Adrian Heine 2017-03-30 13:54:40 +02:00
parent d5a3a85e9a
commit 1bb22db692
10 changed files with 248 additions and 16 deletions

View file

@ -57,9 +57,9 @@ impl<'a> NginxServer<'a, String> {
server_name {};
return 302 $scheme://{}$request_uri;
}}
}}
", redir_domain, domain)).fold(String::new(), |s, v| s + &v);
", redir_domain, domain)).fold(String::new(), |s, v| s + &v);
let proxy_content = if let Some(socket) = socket_path {
format!("location / {{
@ -71,7 +71,7 @@ location @proxy {{
proxy_pass http://unix:{}:;
proxy_redirect off;
}}", socket)
} else { "".to_string() };
} else { "\ntry_files $uri $uri/ $uri.html =404;".to_string() }; // FIXME: This is a crude hack
let content = String::from(redir_content) + &format!("server {{
listen 80;
@ -82,7 +82,8 @@ location @proxy {{
root {};
{}
}}", domain, static_path, proxy_content);
}}
", domain, static_path, proxy_content);
NginxServer {
command_runner: command_runner,
file: FileSymbol::new(file_path, content)