OpenResty
Learn how to use the OpenResty module.
Deploy
Submit a support request by clicking the Support link in the left sidebar to have the OpenResty module deployed.
Manage
Manage the OpenResty module through the Git config.
tip
Check out the related OpenResty documentation to get started with customizing your OpenResty module.
note
Submit a support request by clicking the Support link in the left sidebar if you need help managing this module.
Whitelist origin requests
Follow the steps below to whitelist requests made to the origin for an environment in your project:
Go to the Git config of the environment from which you want to whitelist requests made to the origin.
In the environment's
openresty/server.conf
file, set theCloudFlow-Shared-Secret
request header, replacing<your_shared_secret>
with a secret that will be checked on the origin (e.g.RTio4vNHfxiWabqKxj8PZ99k
):openresty/server.confproxy_set_header CloudFlow-Shared-Secret <your_shared_secret>;
Whitelist the
CloudFlow-Shared-Secret
request header on the origin server, for example:nginx.conflocation / {
if ($http_cloudflow_shared_secret != <your_shared_secret>) {
return 403;
}
}.htaccessRewriteEngine On
RewriteCond %{HTTP:CloudFlow-Shared-Secret} !<your_shared_secret>
RewriteRule ^ - [F]note
The examples above demonstrate blocking all requests that do not contain the following request header:
CloudFlow-Shared-Secret: <your_shared_secret>
IP blocking
Follow the steps below to enable IP blocking for an environment in your project:
Go to the Git config of the environment you want to enable IP blocking for.
In the environment's
openresty/server.conf
file, set a conditional checking theTrue-Client-IP
request header, replacing123.456.789.10
with the IP address you want to block:openresty/server.confif ($http_true_client_ip == 123.456.789.10) {
return 403;
}
Delete
Follow the steps below to delete the OpenResty module from your environment:
Go to the Git config of the environment you want to delete the OpenResty module from.
In the top of the page, copy the URL next to Clone with HTTPS.
Open a terminal and change the current working directory to the location where you want the cloned environment repository.
Clone the environment repository to your local computer. Type
git clone
followed by the copied URL and then press Enter:git clone <copied_url>
In the root directory of the environment repository, delete the OpenResty module directory (typically named
openresty
).note
Skip this step to disable the module instead of deleting it.
In the environment's
section.config.json
file, delete the module object from theproxychain
array, which will look like the following:section.config.json...
"proxychain": [
...
{
"name": "<module_directory_name>",
"image": "<module_image>"
},
...
],
...section.config.json...
"proxychain": [
...
{
"name": "openresty",
"image": "openresty:latest"
},
...
],
...Stage, commit, and push the changes to the environment's remote repository:
git add .
git commit -m "Delete the OpenResty module"
git push