How to use OPSWAT ICAP NGINX Module in Docker environment?

This article applies to all MetaDefender ICAP Server releases deployed on Windows and Linux systems.

Preparation

A Linux machine with Docker installed. You can install Docker with this command

HTML
Copy

Create a folder on your machine and cd into it

Download the OPSWAT ICAP NGINX Module

Now, go to my.opswat.com and look for the NGINX module library file in the ICAP download page. Choose the Debian version, then download the file using WGET/CURL

Remember the NGINX version of the file you downloaded. You will need this for the next step. Here, the version is 1.22.1

Define NGINX version

Run this in your Linux machine. Replace <YOUR_VERSION_HERE> with the NGINX version you obtained from the above step.

HTML
Copy

Create the Dockerfile

In the same folder, create a file name Dockerfile. Then edit the file using nano/vim.

HTML
Copy

Save the file. Now you have the Dockerfile to build the image.

Build the image

Use the below command. Remember to define the $NGINX_BASE_VERSION environment variable before you run.

HTML
Copy

Docker will begin to build the image

After the build has completed, verify that the image has been built with docker image list. You should see your image with the tag is your NGINX version.

Using the Image

Stay in the current folder or create an another folder you desired. This is where we will put our config files for NGINX. You will need: nginx.conf file and your SSL certificate (optional).

Sample nginx.conf file for ICAP scanning:

nginx.conf with ICAP:

HTML
Copy

nginx.conf with ICAPS:

HTML
Copy

Replace:

ometascan_pass with your MD ICAP server URL.

ometascan_ssl_trusted_certificate you can leave this as is or comment it out if you are not using ICAPS.

proxy_pass upstream server URL

You can also modify other options by removing the # comments and edit.

Your folder should contains this two files before running the below command

Start the container:

With SSL Certificate (ICAPS):

Docker
Copy

Replace <YOUR_CRT_FILE_NAME> with your ICAP SSL certificate file name. In this example, the name is my_icap_crt.crt

Without SSL Certificate (ICAP):

Docker
Copy

If Further Assistance is required, please proceed to log a support case or chatting with our support engineer.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard