Skip to main content
Git Interface

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:

  1. Go to the Git config of the environment from which you want to whitelist requests made to the origin.

  2. In the environment's openresty/server.conf file, set the CloudFlow-Shared-Secret request header, replacing <your_shared_secret> with a secret that will be checked on the origin (e.g. RTio4vNHfxiWabqKxj8PZ99k):

    openresty/server.conf
    proxy_set_header CloudFlow-Shared-Secret <your_shared_secret>;
  3. Whitelist the CloudFlow-Shared-Secret request header on the origin server, for example:

    nginx.conf
    location / {
    if ($http_cloudflow_shared_secret != <your_shared_secret>) {
    return 403;
    }
    }
    .htaccess
    RewriteEngine 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:

  1. Go to the Git config of the environment you want to enable IP blocking for.

  2. In the environment's openresty/server.conf file, set a conditional checking the True-Client-IP request header, replacing 123.456.789.10 with the IP address you want to block:

    openresty/server.conf
    if ($http_true_client_ip == 123.456.789.10) {
    return 403;
    }

Delete

Follow the steps below to delete the OpenResty module from your environment:

  1. Go to the Git config of the environment you want to delete the OpenResty module from.

  2. In the top of the page, copy the URL next to Clone with HTTPS.

  3. Open a terminal and change the current working directory to the location where you want the cloned environment repository.

  4. Clone the environment repository to your local computer. Type git clone followed by the copied URL and then press Enter:

    git clone <copied_url>
  5. 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.

  6. In the environment's section.config.json file, delete the module object from the proxychain 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"
    },
    ...
    ],
    ...
  7. Stage, commit, and push the changes to the environment's remote repository:

    git add .
    git commit -m "Delete the OpenResty module"
    git push