You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+66-6
Original file line number
Diff line number
Diff line change
@@ -199,6 +199,50 @@ This setup serve images from other public origin servers, as well as from Amazon
199
199
You can learn how to serve files from private storage in the [configurations section](#serving-files-from-private-storage).
200
200
201
201
202
+
#### Base64 encoded URLs
203
+
204
+
The source URL can be encrypted with URL-safe Base64, prepended by the `/@base64/` prefix. So you can access the remote images like the below:
205
+
206
+
<small>Note: the image source is from NASA, it may be unavailable in the future.</small>
207
+
208
+
<pstyle="color:red">⚠️ Warning: Since this project has simplified the "URL signature" function of imgproxy, please be cautious with the use of Base64-encoded URLs. Malicious actors could exploit this to process images from any untrusted sources for unethical purposes.</p>
209
+
210
+
> Image with no preset (it is resized to max-width=1600 as default).<br/>
@@ -329,7 +373,7 @@ If you like this setup, please [support my works](#support-my-activities) 😉.
329
373
330
374
Create a folder `certs/` in the same place with the `docker-compose.yml` file, then rename and put your SSL certificates `server.crt` and `server.key` to that `certs/` folder.
331
375
332
-
Open the file at [`nginx/nginx.conf`](nginx/nginx.conf#L113~L116) and uncomment 4 lines right after the `# SSL` line, like this:
376
+
Open the file at [`nginx/nginx.conf`](nginx/nginx.conf#L120~L124) and uncomment 4 lines right after the `# SSL` line, like this:
333
377
334
378
```nginx
335
379
# SSL
@@ -344,7 +388,7 @@ Then run the command in the [Start the server](#start-the-server) section to rec
344
388
345
389
### Serving files from private storage
346
390
347
-
Please uncomment settings in `docker-compose.yml` file to enable serving files from [Amazon S3 buckets](docker-compose.yml#L179~L184), [Google Cloud](docker-compose.yml#L186~L189) or [Azure Blob](docker-compose.yml#L191~L196), etc. Then run the command in the [Start the server](#start-the-server) section to recreate and restart the service.
391
+
Please uncomment settings in `docker-compose.yml` file to enable serving files from [Amazon S3 buckets](docker-compose.yml#L177~L182), [Google Cloud](docker-compose.yml#L184~L187) or [Azure Blob](docker-compose.yml#L189~L194), etc. Then run the command in the [Start the server](#start-the-server) section to recreate and restart the service.
348
392
349
393
You can find more details on [imgproxy documentation](https://docs.imgproxy.net/configuration/options?#image-sources).
350
394
@@ -362,22 +406,30 @@ Then run the command in the [Start the server](#start-the-server) section to res
362
406
363
407
### Advanced settings
364
408
365
-
All settings for handling image URLs are written in the [`imgproxy.conf`](imgproxy.conf#L70~L270) file using [Nginx's map directives](https://Nginx.org/en/docs/http/ngx_http_map_module.html#directives).
409
+
All settings for handling image URLs are written in the [`imgproxy.conf`](imgproxy.conf#L70~L295) file using [Nginx's map directives](https://Nginx.org/en/docs/http/ngx_http_map_module.html#directives).
366
410
367
411
I keep all configurations in very simple variables. You can also make your own version from this base.
368
412
369
413
370
414
> **`$use_imgproxy`**<br/>
371
415
> This flag indicates that the request will be proceeded by `imgproxy`.
372
416
> ```nginx
373
-
> map $file_uri $use_imgproxy
417
+
> map $uri_omitted_origin_preset $use_imgproxy
374
418
> {
375
419
> default 0;
376
420
>
377
421
> # Add any rules that you want to skip image processing.
378
422
> #> E.g. this line excludes files under "hq-cactus" folder.
379
423
> ~^/hq-cactus/ 0;
380
424
>
425
+
> # File URL is base64-encoded
426
+
> #> Warning: Since this project has simplified the "URL signature" function of imgproxy,
427
+
> #> please be cautious with the use of Base64-encoded URLs.
428
+
> #> Malicious actors could exploit this to process images from any untrusted sources for unethical purposes.
429
+
> #> Comment out these two lines to disable Base64-encoded URLs.
430
+
> ~^/@base64/ 1;
431
+
> ~[-A-Za-z0-9+/]*=*$ 1;
432
+
>
381
433
> # Else, process all image files with these file extensions
382
434
> ~*\.(jpe?g|png|gif|tiff?|bmp)$ 1;
383
435
> }
@@ -399,6 +451,14 @@ I keep all configurations in very simple variables. You can also make your own v
0 commit comments