# Web Proxy

This guide explains how to connect using the WEB Proxy method via the Weekerp API.

Connect images uploaded on the web to Weekerp.

#### Required information for connection

To allow Weekerp to access your images, you need to provide the following:

* Target URL

#### 1. Understanding Web Proxy

1. Users request images through the Weekerp CDN URL.

   ex) `https://cdn.weekerp.com/image/{alias}/dog.jpg`
2. Weekerp fetches the image from the **Target URL (origin server)** connected to `{alias}`.

   ex) `https://raw.githubusercontent.com/weekerp/test-assets/main` + `/dog.jpg`
3. The origin server returns the image file.

   ex) `https://raw.githubusercontent.com/weekerp/test-assets/main/dog.jpg`
4. Weekerp processes the response, delivers it to users, and caches it for 1 year.
5. After that, the same request is served quickly from cache without calling the origin.

{% hint style="info" %}
WEB PROXY can be connected using only a “publicly accessible URL,” **without bucket/key.**
{% endhint %}

If the origin server requires credentials, you can add authentication headers (e.g., `Authorization`) via Custom Headers.

Custom Headers cannot currently be configured directly in the Weekerp console. However, the capability is available internally—if you need it, please contact us via ([inquiry link](https://accounts.weekerp.com/support?redirect_uri=https%3A%2F%2Fweekerp.com\&lang=en)).

#### 2. Connection example (Target server: GitHub Repo)

* Upload images and videos to a GitHub repository.
* GitHub resources can be accessed via URL.

#### 3. Repository information

The image repository on GitHub is as follows:

`https://raw.githubusercontent.com/weekerp/test-assets/main`

{% embed url="<https://github.com/weekerp/test-assets>" %}

#### 4. Example stored files

There are 4 files under this path.

<figure><img src="https://2148242329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxGV4or1Scr0ygVH4EZcP%2Fuploads%2F9nO9kj5E7FEuOaVvN22U%2F4.png?alt=media&#x26;token=332709dc-c060-4e16-829d-74aad01e93c1" alt=""><figcaption></figcaption></figure>

#### 5. Public image requirements

The image must be publicly accessible like this:

<https://raw.githubusercontent.com/weekerp/test-assets/main/dog.jpg>

#### 6. You must have the following ready

1. Target Url (Step #5)

#### 7. After logging into Weekerp, click “Add Source” at the top-right

1. [Log in to Weekerp](https://weekerp.com/space/callback)
2. Click the “Source” tab
3. Click “Add Source”

<figure><img src="https://2148242329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxGV4or1Scr0ygVH4EZcP%2Fuploads%2FMUpvEAke8EBJIR8jIr6J%2F7.png?alt=media&#x26;token=3987f2b0-872a-4fb4-9965-33f79bea48b4" alt=""><figcaption></figcaption></figure>

#### 8. Select “Static via WEB Proxy”

<figure><img src="https://2148242329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxGV4or1Scr0ygVH4EZcP%2Fuploads%2FmU8L1X0RuCgbxG67MZaJ%2F8.png?alt=media&#x26;token=47fc51c7-b4c0-4ff1-9bcb-59943a74ed08" alt=""><figcaption></figcaption></figure>

#### 9. Enter connection information

1. Enter the Target URL
2. (If needed) Set Base Path

<figure><img src="https://2148242329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxGV4or1Scr0ygVH4EZcP%2Fuploads%2F5lYO5bP0fSNphvgZWnRO%2F9.png?alt=media&#x26;token=e3935d2c-2f1a-41df-977c-988213d53851" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
BasePath sets the root directory for origin requests.
{% endhint %}

If files are stored like below, BasePath can be set to `/` or `/assets`.

* /dog.jpg
* /assets/cat.png

**Request example**

* `cdn.weekerp.com/image/{alias}/dog.jpg`

**Origin request**

* **With BasePath set:** <https://static.example.com/**`assets`**/dog.jpg>
* **Without BasePath:** <https://static.example.com/dog.jpg>

For more details, please refer to [basepath](https://weekerp.gitbook.io/image/storage/basepath "mention").

#### 10. Enter the source alias (alias)

1. Enter the alias you want to use
2. Create the alias

<figure><img src="https://2148242329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxGV4or1Scr0ygVH4EZcP%2Fuploads%2FcYtaa1yAjHbkhprPnB8E%2F10.png?alt=media&#x26;token=626cfdcb-6492-4578-a050-1226af4a122f" alt=""><figcaption></figcaption></figure>

#### 11. Verify the created data source

<figure><img src="https://2148242329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxGV4or1Scr0ygVH4EZcP%2Fuploads%2FjokvG02As6UcNG4szm2y%2F11.png?alt=media&#x26;token=2f738588-7c91-490c-9add-e3c77567a865" alt=""><figcaption></figcaption></figure>

#### Use it like this:

cdn.weekerp.com/<mark style="color:red;">`image`</mark>/`weekerp-assets`/dog.jpg

cdn.weekerp.com/<mark style="color:red;">`image`</mark>/`weekerp-assets`/dog.jpg?ai=Rotate the image to the right

cdn.weekerp.com/<mark style="color:red;">`video`</mark>/`weekerp-assets`/test-video.mp4

All settings are complete.

Typically, it takes 5–10 minutes to propagate the connection across all global environments.
