Skip to content

Commit 22b6b95

Browse files
committed
fix problem
1 parent 7367b3a commit 22b6b95

File tree

1 file changed

+25
-21
lines changed

1 file changed

+25
-21
lines changed

nginx-proxy/templates/service.ctmpl

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
11
{{range services}}
22
{{if in .Tags "entrypoint"}}
3-
server {
4-
listen 80;
5-
server_name {{.Name}}.dev;
3+
{{range service .Name "any"}}
4+
{{if eq .Port "80"}}
5+
server {
6+
listen 80;
7+
server_name {{.Name}}.dev;
68

7-
location / {
8-
proxy_set_header X-Real-IP $remote_addr;
9-
proxy_set_header HOST $http_host;
10-
proxy_set_header X-NginX-Proxy true;
9+
location / {
10+
proxy_set_header X-Real-IP $remote_addr;
11+
proxy_set_header HOST $http_host;
12+
proxy_set_header X-NginX-Proxy true;
13+
proxy_pass http://{{.Address}};
14+
proxy_redirect off;
15+
}
16+
gzip on;
17+
gzip_disable "msie6";
1118

12-
{{range service .Name "any"}}
13-
proxy_pass http://{{.Address}};
14-
{{end}}
15-
proxy_redirect off;
19+
gzip_vary on;
20+
gzip_proxied any;
21+
gzip_comp_level 6;
22+
gzip_buffers 16 8k;
23+
gzip_http_version 1.1;
24+
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
1625
}
17-
gzip on;
18-
gzip_disable "msie6";
19-
20-
gzip_vary on;
21-
gzip_proxied any;
22-
gzip_comp_level 6;
23-
gzip_buffers 16 8k;
24-
gzip_http_version 1.1;
25-
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
26-
}
26+
{{end}}
27+
{{if eq .Port "443"}}
28+
#Coming soon
29+
{{end}}
30+
{{end}}
2731
{{end}}
2832
{{end}}

0 commit comments

Comments
 (0)