mirror of
https://github.com/hacdias/webdav.git
synced 2026-09-24 04:01:54 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aad8e563a7 | ||
|
|
8446f9bdae |
@@ -193,6 +193,14 @@ location / {
|
|||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
|
|
||||||
|
# Ensure COPY and MOVE commands work. Change https://example.com to the
|
||||||
|
# correct address where the WebDAV server will be deployed at.
|
||||||
|
set $dest $http_destination;
|
||||||
|
if ($http_destination ~ "^https://example.com(?<path>(.+))") {
|
||||||
|
set $dest /$path;
|
||||||
|
}
|
||||||
|
proxy_set_header Destination $dest;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package lib
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@@ -53,6 +54,10 @@ func ParseConfig(filename string, flags *pflag.FlagSet) (*Config, error) {
|
|||||||
// Configuration file settings
|
// Configuration file settings
|
||||||
v.AddConfigPath(".")
|
v.AddConfigPath(".")
|
||||||
v.AddConfigPath("/etc/webdav/")
|
v.AddConfigPath("/etc/webdav/")
|
||||||
|
if path, err := os.Executable(); err == nil {
|
||||||
|
v.AddConfigPath(filepath.Dir(path))
|
||||||
|
}
|
||||||
|
|
||||||
v.SetConfigName("config")
|
v.SetConfigName("config")
|
||||||
if filename != "" {
|
if filename != "" {
|
||||||
v.SetConfigFile(filename)
|
v.SetConfigFile(filename)
|
||||||
|
|||||||
Reference in New Issue
Block a user