Getting started

Integration & migration

Image & video API

DAM user guide

API overview


Integrate Web Server with

Connect your web server as an external storage with ImageKit to get real-time image and video optimization and transformation capabilities in minutes.

Any web server, e.g., Nginx, ELB, ALB, EC2, Magento, WordPress, etc., or storage that is accessible over HTTP or HTTPS can be configured as an origin in This allows you to use's real-time image and video optimization, transformation, and other features on all existing files.

Before continuing, understand how external storage integration works, what is URL endpoint, and how to troubleshoot 404 errors.

Step 1: Configure origin

  1. Go to the External Storage section in your dashboard, and click on the "Add New" button.
  2. Choose "Web Folder" from the Origin type dropdown.
  3. Give your origin a name. It will appear in the list of origins you have added. For example - Website Server.
  4. Fill out the base URL, for example, if your current file URL is, then enter as the base URL.
  5. Leave the advanced options as it is for now.
  6. Click on the Save button.

Whitelist request from
Make sure that the file URL is accessible from Learn more.

Step 2: Access the file through URL endpoint

When you add your first external source (origin) in the dashboard, the origin is, by default, made accessible through the default URL endpoint of your account. For subsequent origins, you can either create a separate URL endpoint or edit the existing URL endpoint (including default) and make this newly added origin accessible by editing the origin preference list.

When you request, internally fetches the file from

            URL endpoint                transformation      file path 

Let's look at a few examples of how to fetch an image file. The same would work for other file types as well.

If you get a "Not found" error while accessing the file, check out this troubleshooting guide.

You can also use a custom domain like

Step 3: Integrate and Go live

Start using URLs in your application to deliver perfect images and videos.

Advanced options for web server origin

Include canonical response header

When enabled, the response contains a Link header with the appropriate URL and rel=canonical. You will have to specify the base URL for the canonical header.

For example, if you set as the base URL for the canonical header, then the response headers for URL will have a Link header like this:

Link: <>; rel="canonical"

Forward Host header to this origin

By default, when tries to get the file from your origin, the value of the Host header is the same as the base URL specified for the origin. For example, if the base URL is, then gets forwarded to your origin.

However, when this setting is enabled, the host value from the actual URL, not the base URL, will be forwarded to the origin as the Host header. This is done only when you use a custom domain name for your URLs. For example, if you are using a custom domain name for your file URLs, like, then gets forwarded to your origin as the Host header instead of