Merge pull request #8493 from dokku/6760-build-empty-nginx-config-when-there-are-no-web-processes
Generate 502 config for apps without web listeners
This commit is contained in:
15
docs/appendices/0.38.0-migration-guide.md
Normal file
15
docs/appendices/0.38.0-migration-guide.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# 0.38.0 Migration Guide
|
||||
|
||||
## Changes
|
||||
|
||||
- Dokku now generates a minimal nginx configuration for apps without running `web` processes (undeployed apps, apps with no `web` process type, or apps with stopped web processes). This configuration returns `502 Bad Gateway` responses, ensuring the app's domain resolves and monitoring tools can detect non-200 status codes. The configuration is automatically replaced with the full proxy configuration once the app is deployed with running `web` processes. See the [nginx documentation](/docs/networking/proxies/nginx.md#nginx-configuration-for-undeployed-apps) for more details.
|
||||
- Users with custom `nginx.conf.sigil` templates that reference `DOKKU_APP_WEB_LISTENERS` should be aware that this variable may now be empty when the template is rendered for apps without running web processes. Custom templates should handle this case gracefully, for example by using a conditional to serve an error page instead of proxying:
|
||||
```
|
||||
location / {
|
||||
{{ if $.DOKKU_APP_WEB_LISTENERS }}
|
||||
proxy_pass http://{{ $.APP }}-{{ $upstream_port }};
|
||||
{{ else }}
|
||||
return 502;
|
||||
{{ end }}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user