Optimize images from your web server with ImageKit

Here are the steps to optimize images from your existing HTTP or HTTPS image server using ImageKit

Steps to optimize images from a Web Server using ImageKit

1. Let us assume that currently your images are accessed using


2. Log in to your ImageKit dashboard and go to the Integration section. Click on  the “Add New Source” button.

3. In the form that opens up, select “Web Server” as the “Origin Type”. You can give this source any “Origin Name”.

4. Enter your image server name with the protocol in the “Base URL” field. For our example, this will be http://www.mydomain.com. This ensures that ImageKit can access any image accessible on http://www.mydomain.com

5. Click on “Save”.

6. In the “Image URL Patterns” section,  you will find this new source added in “Image Origin Preference” with the “Default URL pattern”.

7. You can either continue to use the “Default URL pattern” or create a new pattern for your HTTP server images as described here.

8. Example – If your existing image URL was http://www.mydomain.com/path/to/my/image.jpg then the image will be accessible using

With default URL pattern


With custom URL pattern

9. In the “Base URL” field, you can also enter the image path prefix. For example, if your image URL is http://www.mydomain.com/path/to/my/image.jpg, then you can enter http://www.mydomain.com/path/to/ in the “Base URL” field. This ensures that ImageKit can only access images beginning with http://www.mydomain.com/path/to/. Correspondingly, the ImageKit URL would look like this

With default URL pattern


With custom URL pattern

Using this method of attaching your HTTP or HTTPS web server to ImageKit, you can optimize images and transform them using ImageKit in minutes. Nginx and Apache are popular web servers that can be integrated with ImageKit in this way. WordPress and Shopify integrations too work on similar lines.

Please reach out to us at developer@imagekit.io in case you have any questions or concerns about the above integration or if you want our team to assist you with these changes.