|
|
@ -165,7 +165,7 @@ pub fn uwsgi_snippet<S: SocketSpec, STATIC: AsRef<Path>>( |
|
|
|
}
|
|
|
|
|
|
|
|
#[must_use]
|
|
|
|
pub fn static_snippet<S: AsRef<Path>>(static_path: S) -> String {
|
|
|
|
pub fn static_snippet(static_path: impl AsRef<Path>) -> String {
|
|
|
|
format!(
|
|
|
|
"root {};
|
|
|
|
try_files $uri $uri/ $uri.html =404;
|
|
|
@ -175,7 +175,7 @@ pub fn static_snippet<S: AsRef<Path>>(static_path: S) -> String { |
|
|
|
}
|
|
|
|
|
|
|
|
#[must_use]
|
|
|
|
pub fn dokuwiki_snippet() -> String {
|
|
|
|
pub const fn dokuwiki_snippet() -> &'static str {
|
|
|
|
"
|
|
|
|
location ~ /(data/|conf/|bin/|inc/|install.php) { deny all; }
|
|
|
|
|
|
|
@ -187,11 +187,11 @@ pub fn dokuwiki_snippet() -> String { |
|
|
|
rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
|
|
|
|
rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
|
|
|
|
rewrite ^/(.*) /doku.php?id=$1&$args last;
|
|
|
|
}".into()
|
|
|
|
}"
|
|
|
|
}
|
|
|
|
|
|
|
|
#[must_use]
|
|
|
|
pub fn nextcloud_snippet() -> String {
|
|
|
|
pub const fn nextcloud_snippet() -> &'static str {
|
|
|
|
"
|
|
|
|
client_max_body_size 500M;
|
|
|
|
|
|
|
@ -241,5 +241,20 @@ pub fn nextcloud_snippet() -> String { |
|
|
|
access_log off;
|
|
|
|
}
|
|
|
|
"
|
|
|
|
.into()
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
mod test {
|
|
|
|
use super::default_server;
|
|
|
|
#[test]
|
|
|
|
fn test_default_server() {
|
|
|
|
assert_eq!(
|
|
|
|
default_server("filename"),
|
|
|
|
r#"server {
|
|
|
|
listen 80 default_server;
|
|
|
|
listen [::]:80 default_server;
|
|
|
|
include "filename";
|
|
|
|
}"#
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|