<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Configuration on WebP Server Documentation</title><link>https://docs.webp.sh/configuration/</link><description>Recent content in Configuration on WebP Server Documentation</description><generator>Hugo</generator><language>en</language><atom:link href="https://docs.webp.sh/configuration/index.xml" rel="self" type="application/rss+xml"/><item><title>MultiPath</title><link>https://docs.webp.sh/configuration/multipath/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.webp.sh/configuration/multipath/</guid><description>&lt;h1 id="multipath"&gt;
 MultiPath
 &lt;a class="anchor" href="#multipath"&gt;#&lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;Starting from version &lt;code&gt;0.9.9&lt;/code&gt;, we&amp;rsquo;re supporting multipath, thanks to contribution by 
 &lt;a href="https://github.com/bugfest"&gt;@bugfest&lt;/a&gt; ❤️.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;d like to use multiple path for serving different images, you can use the new &lt;code&gt;config.json&lt;/code&gt; format. You can specify additional paths mappings under &lt;code&gt;IMG_MAP&lt;/code&gt; dict.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;IMG_MAP&lt;/code&gt;&amp;rsquo;s keys are URIs or Hosts names will be translated to their corresponding mapped value. It works in two different modes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;URI map: Keys have the form &lt;code&gt;/.*&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Host map: Keys have the form &lt;code&gt;http?s://.*&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Keys not matching this format will be ignored&lt;/p&gt;</description></item><item><title>Remote Backend</title><link>https://docs.webp.sh/configuration/remote-backend/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.webp.sh/configuration/remote-backend/</guid><description>&lt;h1 id="remote-backend"&gt;
 Remote Backend
 &lt;a class="anchor" href="#remote-backend"&gt;#&lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;WebP Server Go can fetch original images from a remote HTTP or HTTPS origin, optimize them, and cache the results locally.&lt;/p&gt;
&lt;h2 id="automatic-detection"&gt;
 Automatic detection
 &lt;a class="anchor" href="#automatic-detection"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Remote (proxy) mode is enabled when the resolved image source is an &lt;code&gt;http://&lt;/code&gt; or &lt;code&gt;https://&lt;/code&gt; URL:&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Configuration&lt;/th&gt;
 &lt;th&gt;Remote when&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;IMG_PATH&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Value is an &lt;code&gt;http://&lt;/code&gt; or &lt;code&gt;https://&lt;/code&gt; URL (for example &lt;code&gt;https://cdn.example.com/assets&lt;/code&gt;)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;IMG_MAP&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;A matched mapping value is an &lt;code&gt;http://&lt;/code&gt; or &lt;code&gt;https://&lt;/code&gt; URL (see 
 &lt;a href="https://docs.webp.sh/configuration/multipath/"&gt;MultiPath&lt;/a&gt;)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Otherwise the server serves and converts images from local filesystem paths.&lt;/p&gt;</description></item><item><title>Configuration</title><link>https://docs.webp.sh/configuration/configuration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.webp.sh/configuration/configuration/</guid><description>&lt;h1 id="configuration"&gt;
 Configuration
 &lt;a class="anchor" href="#configuration"&gt;#&lt;/a&gt;
&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;This is the unified documentation, please use the latest version of WebP Server Go if possible as some configuration might not be available in previous versions.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;WebP Server Go can be configured by the following ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;config.json&lt;/code&gt; file&lt;/li&gt;
&lt;li&gt;Environment variables&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Priority: Environment variables &amp;gt; &lt;code&gt;config.json&lt;/code&gt; file.&lt;/p&gt;
&lt;h2 id="configuration-changelog"&gt;
 Configuration changelog
 &lt;a class="anchor" href="#configuration-changelog"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;blockquote class="book-hint info"&gt;
 &lt;ul&gt;
&lt;li&gt;Remote mode is detected automatically from &lt;code&gt;http(s)&lt;/code&gt; URLs in &lt;code&gt;IMG_PATH&lt;/code&gt; / &lt;code&gt;IMG_MAP&lt;/code&gt;; &lt;code&gt;ProxyMode&lt;/code&gt; has been removed.&lt;/li&gt;
&lt;li&gt;Security-related invalid paths and &lt;code&gt;meta=full&lt;/code&gt; on missing resources now return &lt;code&gt;404&lt;/code&gt; (see 
 &lt;a href="https://docs.webp.sh/reference/security/"&gt;Security&lt;/a&gt; and 
 &lt;a href="https://docs.webp.sh/reference/query-parameters/"&gt;Query parameters&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;MAX_CACHE_SIZE&lt;/code&gt; is added at version 0.12.0&lt;/li&gt;
&lt;li&gt;&lt;code&gt;EXTRA_PARAMS_CROP_INTERESTING&lt;/code&gt; is added at version 0.11.2&lt;/li&gt;
&lt;li&gt;&lt;code&gt;STRIP_METADATA&lt;/code&gt;, &lt;code&gt;CONVERT_TYPES&lt;/code&gt; is added at version 0.11.0, dropped &lt;code&gt;ENABLE_AVIF&lt;/code&gt; entry.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CACHE_TTL&lt;/code&gt; is added at version 0.10.7&lt;/li&gt;
&lt;li&gt;&lt;code&gt;READ_BUFFER_SIZE&lt;/code&gt;, &lt;code&gt;CONCURRENCY&lt;/code&gt; and &lt;code&gt;DISABLE_KEEPALIVE&lt;/code&gt; is added at version 0.9.12&lt;/li&gt;
&lt;/ul&gt;

&lt;/blockquote&gt;

&lt;h2 id="remote-backend-detection"&gt;
 Remote backend detection
 &lt;a class="anchor" href="#remote-backend-detection"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;WebP Server Go enables remote (origin-fetch) mode &lt;strong&gt;automatically&lt;/strong&gt; when the resolved image source is an &lt;code&gt;http://&lt;/code&gt; or &lt;code&gt;https://&lt;/code&gt; URL:&lt;/p&gt;</description></item><item><title>Configuration Examples</title><link>https://docs.webp.sh/configuration/examples/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.webp.sh/configuration/examples/</guid><description>&lt;h1 id="configuration-examples"&gt;
 Configuration Examples
 &lt;a class="anchor" href="#configuration-examples"&gt;#&lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;Use this page as a quick selector for common deployment patterns. Pick the closest scenario, copy the minimal config, then adjust paths and domains.&lt;/p&gt;
&lt;h2 id="scenario-overview"&gt;
 Scenario overview
 &lt;a class="anchor" href="#scenario-overview"&gt;#&lt;/a&gt;
&lt;/h2&gt;


&lt;script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"&gt;&lt;/script&gt;

 &lt;script&gt;mermaid.initialize({
 "flowchart": {
 "useMaxWidth":true
 },
 "theme": "default"
}
)&lt;/script&gt;




&lt;p class="mermaid"&gt;
flowchart TD
 startNode["Choose image source pattern"] --&gt; singleLocal["Single local directory"]
 startNode --&gt; multiLocal["Multiple local directories"]
 startNode --&gt; remoteOnly["Remote origin only"]
 startNode --&gt; mixedMode["Local + remote mixed"]

 singleLocal --&gt; useImgPath["Use IMG_PATH as local path"]
 multiLocal --&gt; useImgMapLocal["Use IMG_MAP with local prefixes"]
 remoteOnly --&gt; useImgPathRemote["Use IMG_PATH as https URL"]
 mixedMode --&gt; useImgMapMixed["Use IMG_MAP with local and https targets"]

 useImgPath --&gt; localExample["See Local single directory"]
 useImgMapLocal --&gt; multiExample["See Local multi-directory with IMG_MAP"]
 useImgPathRemote --&gt; remoteExample["See Remote backend address"]
 useImgMapMixed --&gt; mixedExample["See Mixed local and remote mappings"]
&lt;/p&gt;</description></item></channel></rss>