Introduced in 0.31.0
openresty:report [<app>] [<flag>] # Displays a openresty report for one or more apps openresty:logs [--num num] [--tail] # Display openresty log output openresty:set <app> <property> (<value>) # Set or clear an openresty property for an app openresty:show-config <app> # Display openresty compose config openresty:start # Starts the openresty server openresty:stop # Stops the openresty server
openresty plugin integration requires the
docker-compose-plugin for Docker. See this document from the Docker documentation for more information on the installation process for the
As using multiple proxy plugins on a single Dokku installation can lead to issues routing requests to apps, doing so should be avoided. As the default proxy implementation is nginx, users are encouraged to stop the nginx service before switching to OpenResty.
The OpenResty plugin has specific rules for routing requests:
- OpenResty integration is exposed via docker labels attached to containers. Changes in labels require either app deploys or rebuilds.
- While OpenResty will respect labels associated with other containers, only
webcontainers have OpenResty labels injected by the plugin.
https:443port mappings are supported at this time.
- Requests are routed as soon as the container is running and passing healthchecks.
Switching to OpenResty¶
To use the OpenResty plugin, use the
proxy:set command for the app in question:
This will enable the docker label-based OpenResty integration. All future deploys will inject the correct labels for OpenResty to read and route requests to containers. Due to the docker label-based integration used by OpenResty, a single deploy or rebuild will be required before requests will route successfully.
Any changes to domains or port mappings will also require either a deploy or rebuild.
Starting OpenResty container¶
OpenResty can be started via the
openresty:start command. This will start a OpenResty container via the
docker compose up command.
Stopping the OpenResty container¶
OpenResty may be stopped via the
The OpenResty container will be stopped and removed from the system. If the container is not running, this command will do nothing.
Showing the OpenResty compose config¶
For debugging purposes, it may be useful to show the OpenResty compose config. This can be achieved via the
Customizing the OpenResty container image¶
While the default OpenResty image is hardcoded, users may specify an alternative by setting the
image property with the
Checking the OpenResty container's logs¶
It may be necessary to check the OpenResty container's logs to ensure that OpenResty is operating as expected. This can be performed with the
This command also supports the following modifiers:
You can use these modifiers as follows:
The above command will show logs continually from the openresty container, with an initial history of 10 log lines
The OpenResty plugin only supports automatic ssl certificates from it's letsencrypt integration. Managed certificates provided by the
certs plugin are ignored.
Enabling letsencrypt integration¶
By default, letsencrypt is disabled and https port mappings are ignored. To enable, set the
letsencrypt-email property with the
After enabling, the OpenResty container will need to be restarted and apps will need to be rebuilt. All http requests will then be redirected to https.
Customizing the letsencrypt server¶
The letsencrypt integration is set to the production letsencrypt server by default. To change this, set the
letsencrypt-server property with the
After enabling, the OpenResty container will need to be restarted and apps will need to be rebuilt to retrieve certificates from the new server.
Displaying OpenResty reports for an app¶
You can get a report about the app's OpenResty config using the
=====> node-js-app openresty information Openresty image: dokku/openresty-docker-proxy:0.5.6 Openresty letsencrypt email: email@example.com =====> python-app openresty information Openresty image: dokku/openresty-docker-proxy:0.5.6 Openresty letsencrypt email: firstname.lastname@example.org =====> ruby-app openresty information Openresty image: dokku/openresty-docker-proxy:0.5.6 Openresty letsencrypt email: email@example.com
You can run the command for a specific app also.
You can pass flags which will output only the value of the specific information you want. For example: