1 parent
20dfd20416
commit
8cf20db7e1
2 files changed
+11
-12
No files matched your search
@@ -106,6 +106,12 @@ Your application has access to the HTTP headers `X-Forwarded-Proto`, `X-Forwarde
|
|||||||
If your server runs behind an HTTP/S load balancer, then Nginx will see all requests as coming from the load balancer. If your load balancer sets the `X-Forwarded-` headers, you can tell Nginx to pass these headers from load balancer to your application by using the following [nginx custom template](/dokku/nginx/#customizing-the-nginx-configuration)
|
If your server runs behind an HTTP/S load balancer, then Nginx will see all requests as coming from the load balancer. If your load balancer sets the `X-Forwarded-` headers, you can tell Nginx to pass these headers from load balancer to your application by using the following [nginx custom template](/dokku/nginx/#customizing-the-nginx-configuration)
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
upstream {{ .APP }} {
|
||||||
|
{{ range .DOKKU_APP_LISTENERS | split " " }}
|
||||||
|
server {{ . }};
|
||||||
|
{{ end }}
|
||||||
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen [::]:{{ .NGINX_PORT }};
|
listen [::]:{{ .NGINX_PORT }};
|
||||||
listen {{ .NGINX_PORT }};
|
listen {{ .NGINX_PORT }};
|
||||||
@@ -128,12 +134,6 @@ server {
|
|||||||
proxy_set_header X-Request-Start $msec;
|
proxy_set_header X-Request-Start $msec;
|
||||||
}
|
}
|
||||||
include {{ .DOKKU_ROOT }}/{{ .APP }}/nginx.conf.d/*.conf;
|
include {{ .DOKKU_ROOT }}/{{ .APP }}/nginx.conf.d/*.conf;
|
||||||
|
|
||||||
upstream {{ .APP }} {
|
|
||||||
{{ range .DOKKU_APP_LISTENERS | split " " }}
|
|
||||||
server {{ . }};
|
|
||||||
{{ end }}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
+5
-6
@@ -20,6 +20,11 @@ Dokku uses a templating library by the name of [sigil](https://github.com/glider
|
|||||||
|
|
||||||
### Example Custom Template
|
### Example Custom Template
|
||||||
```
|
```
|
||||||
|
upstream {{ .APP }} {
|
||||||
|
{{ range .DOKKU_APP_LISTENERS | split " " }}
|
||||||
|
server {{ . }};
|
||||||
|
{{ end }}
|
||||||
|
}
|
||||||
server {
|
server {
|
||||||
listen [::]:{{ .NGINX_PORT }};
|
listen [::]:{{ .NGINX_PORT }};
|
||||||
listen {{ .NGINX_PORT }};
|
listen {{ .NGINX_PORT }};
|
||||||
@@ -42,12 +47,6 @@ server {
|
|||||||
proxy_set_header X-Request-Start $msec;
|
proxy_set_header X-Request-Start $msec;
|
||||||
}
|
}
|
||||||
include {{ .DOKKU_ROOT }}/{{ .APP }}/nginx.conf.d/*.conf;
|
include {{ .DOKKU_ROOT }}/{{ .APP }}/nginx.conf.d/*.conf;
|
||||||
|
|
||||||
upstream {{ .APP }} {
|
|
||||||
{{ range .DOKKU_APP_LISTENERS | split " " }}
|
|
||||||
server {{ . }};
|
|
||||||
{{ end }}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user