Skip to content

Commit e7fba5e

Browse files
author
Mike Savochkin
authored
Merge pull request #1029 from subutai-io/dev
Dev
2 parents 7506d0d + c6c7ea0 commit e7fba5e

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

lib/proxy/proxy.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
package proxy
22

33
import (
4-
"github.com/nightlyone/lockfile"
5-
"time"
6-
"strings"
7-
"github.com/subutai-io/agent/lib/gpg"
84
"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"
139
"github.com/subutai-io/agent/db"
1410
"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"
1712
"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"
1917
"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"
2319
"regexp"
20+
"sort"
21+
"strconv"
22+
"strings"
23+
"time"
2424
)
2525

2626
//todo split this file into types, snippets,
@@ -66,7 +66,9 @@ server {
6666
6767
{well-known}
6868
69-
return 301 https://$host:{port}$request_uri; # enforce https
69+
location / {
70+
return 301 https://$host:{port}$request_uri; # enforce https
71+
}
7072
}
7173
7274
`
@@ -200,8 +202,7 @@ func FindProxiedServers(tag, socket string) ([]db.ProxiedServer, error) {
200202
func CreateProxy(protocol, domain, loadBalancing, tag string, port int, redirect80Port, sslBackend bool, certPath string, http2 bool) error {
201203
var err error = nil
202204
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") {
205206

206207
time.Sleep(time.Second * 1)
207208
}
@@ -428,8 +429,7 @@ func AddProxiedServer(tag, socket string) error {
428429

429430
var err error = nil
430431
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") {
433433
time.Sleep(time.Second * 1)
434434
}
435435
defer lock.Unlock()
@@ -846,7 +846,7 @@ func figureOutDomainFolderName(domain string) (string, error) {
846846
//collect all matching directory names
847847
var res []string
848848
for _, f := range files {
849-
if f.IsDir() && ( validCertDirName.MatchString(f.Name())) {
849+
if f.IsDir() && (validCertDirName.MatchString(f.Name())) {
850850
res = append(res, filepath.Join(f.Name()))
851851
}
852852
}

0 commit comments

Comments
 (0)