mirror of
https://github.com/woodchen-ink/webp_server_go.git
synced 2025-07-18 13:42:02 +08:00
Update README for CDN specifications.
This commit is contained in:
parent
cb4beb54f7
commit
3f7f7a5cf2
11
README.md
11
README.md
@ -112,10 +112,17 @@ docker run -d -p 3333:3333 -v /path/to/pics:/opt/pics --name webps webpsh/webps
|
|||||||
The path `path/to/pics` is your images serving in local. The path `/opt/pics` unable modify because it define in the `config.json` when building docker image. The cache folder of `EXHAUST_PATH` default define in `/opt/exhaust` , you can also mount the local dir for the cache folder by using `-v /path/to/exhaust:/opt/exhaust` option.
|
The path `path/to/pics` is your images serving in local. The path `/opt/pics` unable modify because it define in the `config.json` when building docker image. The cache folder of `EXHAUST_PATH` default define in `/opt/exhaust` , you can also mount the local dir for the cache folder by using `-v /path/to/exhaust:/opt/exhaust` option.
|
||||||
|
|
||||||
### 4. Nginx proxy_pass
|
### 4. Nginx proxy_pass
|
||||||
Let Nginx to `proxy_pass http://localhost:3333/;`, and your webp-server is on-the-fly
|
Let Nginx to `proxy_pass http://localhost:3333/;`, and your webp-server is on-the-fly.
|
||||||
#### WordPress example
|
|
||||||
|
#### CDN Problem
|
||||||
|
If you use CDN(such as Cloudflare) for your website, we'd recommend you to add a `no-cache` header like the example below, this will prevent your images from being cached and webp images rendered to Safari users(which will of course cause some troubles).
|
||||||
|
|
||||||
|
#### Nginx example
|
||||||
|
|
||||||
|
This is an example for a typical Wordpress installation.
|
||||||
```
|
```
|
||||||
location ^~ /wp-content/uploads/ {
|
location ^~ /wp-content/uploads/ {
|
||||||
|
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
|
||||||
proxy_pass http://127.0.0.1:3333;
|
proxy_pass http://127.0.0.1:3333;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user