|
1 | 1 | package proxy
|
2 | 2 |
|
3 | 3 | import (
|
4 |
| - "github.com/nightlyone/lockfile" |
5 |
| - "time" |
6 |
| - "strings" |
7 |
| - "github.com/subutai-io/agent/lib/gpg" |
8 | 4 | "fmt"
|
9 |
| - "os" |
10 |
| - "io/ioutil" |
11 |
| - "path/filepath" |
12 |
| - "sort" |
| 5 | + "github.com/nightlyone/lockfile" |
| 6 | + "github.com/pkg/errors" |
| 7 | + "github.com/subutai-io/agent/agent/util" |
| 8 | + "github.com/subutai-io/agent/config" |
13 | 9 | "github.com/subutai-io/agent/db"
|
14 | 10 | "github.com/subutai-io/agent/lib/common"
|
15 |
| - "github.com/subutai-io/agent/lib/net" |
16 |
| - "github.com/pkg/errors" |
| 11 | + "github.com/subutai-io/agent/lib/exec" |
17 | 12 | "github.com/subutai-io/agent/lib/fs"
|
18 |
| - "strconv" |
| 13 | + "github.com/subutai-io/agent/lib/gpg" |
| 14 | + "github.com/subutai-io/agent/lib/net" |
| 15 | + "io/ioutil" |
| 16 | + "os" |
19 | 17 | "path"
|
20 |
| - "github.com/subutai-io/agent/config" |
21 |
| - "github.com/subutai-io/agent/lib/exec" |
22 |
| - "github.com/subutai-io/agent/agent/util" |
| 18 | + "path/filepath" |
23 | 19 | "regexp"
|
| 20 | + "sort" |
| 21 | + "strconv" |
| 22 | + "strings" |
| 23 | + "time" |
24 | 24 | )
|
25 | 25 |
|
26 | 26 | //todo split this file into types, snippets,
|
@@ -66,7 +66,9 @@ server {
|
66 | 66 |
|
67 | 67 | {well-known}
|
68 | 68 |
|
69 |
| - return 301 https://$host:{port}$request_uri; # enforce https |
| 69 | + location / { |
| 70 | + return 301 https://$host:{port}$request_uri; # enforce https |
| 71 | + } |
70 | 72 | }
|
71 | 73 |
|
72 | 74 | `
|
@@ -200,8 +202,7 @@ func FindProxiedServers(tag, socket string) ([]db.ProxiedServer, error) {
|
200 | 202 | func CreateProxy(protocol, domain, loadBalancing, tag string, port int, redirect80Port, sslBackend bool, certPath string, http2 bool) error {
|
201 | 203 | var err error = nil
|
202 | 204 | var lock lockfile.Lockfile
|
203 |
| - for lock, err = common.LockFile("port", "proxy"); |
204 |
| - err != nil; lock, err = common.LockFile("port", "proxy") { |
| 205 | + for lock, err = common.LockFile("port", "proxy"); err != nil; lock, err = common.LockFile("port", "proxy") { |
205 | 206 |
|
206 | 207 | time.Sleep(time.Second * 1)
|
207 | 208 | }
|
@@ -428,8 +429,7 @@ func AddProxiedServer(tag, socket string) error {
|
428 | 429 |
|
429 | 430 | var err error = nil
|
430 | 431 | var lock lockfile.Lockfile
|
431 |
| - for lock, err = common.LockFile("port", "server"); |
432 |
| - err != nil; lock, err = common.LockFile("port", "server") { |
| 432 | + for lock, err = common.LockFile("port", "server"); err != nil; lock, err = common.LockFile("port", "server") { |
433 | 433 | time.Sleep(time.Second * 1)
|
434 | 434 | }
|
435 | 435 | defer lock.Unlock()
|
@@ -846,7 +846,7 @@ func figureOutDomainFolderName(domain string) (string, error) {
|
846 | 846 | //collect all matching directory names
|
847 | 847 | var res []string
|
848 | 848 | for _, f := range files {
|
849 |
| - if f.IsDir() && ( validCertDirName.MatchString(f.Name())) { |
| 849 | + if f.IsDir() && (validCertDirName.MatchString(f.Name())) { |
850 | 850 | res = append(res, filepath.Join(f.Name()))
|
851 | 851 | }
|
852 | 852 | }
|
|
0 commit comments