[ci skip] move nginx upstream blocks to the bottom in docs examples
This commit is contained in:
@@ -84,12 +84,6 @@ 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 }};
|
||||||
@@ -113,6 +107,12 @@ server {
|
|||||||
}
|
}
|
||||||
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 }}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Only use this option if:
|
Only use this option if:
|
||||||
|
|||||||
@@ -25,11 +25,6 @@ Dokku uses a templating library by the name of [sigil](https://github.com/glider
|
|||||||
|
|
||||||
Use case: add an `X-Served-By` header to requests
|
Use case: add an `X-Served-By` header to requests
|
||||||
```
|
```
|
||||||
upstream {{ .APP }} {
|
|
||||||
{{ range .DOKKU_APP_LISTENERS | split " " }}
|
|
||||||
server {{ . }};
|
|
||||||
{{ end }}
|
|
||||||
}
|
|
||||||
server {
|
server {
|
||||||
listen [::]:{{ .NGINX_PORT }};
|
listen [::]:{{ .NGINX_PORT }};
|
||||||
listen {{ .NGINX_PORT }};
|
listen {{ .NGINX_PORT }};
|
||||||
@@ -60,6 +55,12 @@ server {
|
|||||||
}
|
}
|
||||||
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 }}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Available template variables
|
### Available template variables
|
||||||
@@ -82,11 +83,6 @@ server {
|
|||||||
### Example HTTP to HTTPS Custom Template
|
### Example HTTP to HTTPS Custom Template
|
||||||
Use case: a simple dockerfile app that includes `EXPOSE 80`
|
Use case: a simple dockerfile app that includes `EXPOSE 80`
|
||||||
```
|
```
|
||||||
upstream {{ .APP }} {
|
|
||||||
{{ range .DOKKU_APP_LISTENERS | split " " }}
|
|
||||||
server {{ . }};
|
|
||||||
{{ end }}
|
|
||||||
}
|
|
||||||
server {
|
server {
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
listen 80;
|
listen 80;
|
||||||
@@ -123,6 +119,12 @@ server {
|
|||||||
}
|
}
|
||||||
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 }}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Customizing via configuration files included by the default templates
|
### Customizing via configuration files included by the default templates
|
||||||
|
|||||||
Reference in New Issue
Block a user