Browse Source

Update

master
Adrian Heine 7 years ago
parent
commit
2481ac9f70
  1. 6
      src/symbols/nginx/reload.rs
  2. 4
      src/symbols/nginx/server.rs
  3. 3
      src/symbols/not_a_symlink.rs

6
src/symbols/nginx/reload.rs

@ -1,19 +1,13 @@
use std::error::Error;
use std::fmt;
use std::io;
use std::ops::Deref;
use command_runner::CommandRunner;
use symbols::Symbol;
use symbols::file::File as FileSymbol;
use resources::Resource;
pub struct NginxReload<'a> {
command_runner: &'a CommandRunner,
}
use std::borrow::Cow;
impl<'a> NginxReload<'a> {
pub fn new(command_runner: &'a CommandRunner) -> Self {
NginxReload {

4
src/symbols/nginx/server.rs

@ -64,7 +64,9 @@ impl<'a> NginxServer<'a, String> {
}
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)
}

3
src/symbols/not_a_symlink.rs

@ -2,11 +2,8 @@ use std::error::Error;
use std::fmt;
use std::fs;
use std::io;
use std::ops::Deref;
use std::path::Path;
use symbols::Symbol;
use resources::{DirResource, Resource};
pub struct NotASymlink<D> where D: AsRef<str> + fmt::Display {
path: D

Loading…
Cancel
Save