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
+44-2Lines changed: 44 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,6 +154,27 @@ This setup serve images from other public origin servers, as well as from Amazon
154
154
155
155
You can learn how to serve files from private storage in the [configurations section](#serving-files-from-private-storage).
156
156
157
+
158
+
### Customize resizing via query string
159
+
160
+
You can also parse arguments from the request's query string, such as `?width=300` for the image's width or `?height=200` for the image's height, or even both of demensions, to flexibly change some parameters for resizing.
161
+
162
+
In this setup example, I used the `width` and `height` arguments to override the existing presets.
See [my configurations](#advanced-settings) to know how it works.
177
+
157
178
---
158
179
159
180
@@ -261,7 +282,7 @@ Then run the command in the [Start the server](#start-the-server) section to res
261
282
262
283
### Advanced settings
263
284
264
-
All settings for handling image URLs are written in the [`imgproxy.conf`](imgproxy.conf#L70~L216) file using [Nginx's map directives](https://Nginx.org/en/docs/http/ngx_http_map_module.html#directives).
285
+
All settings for handling image URLs are written in the [`imgproxy.conf`](imgproxy.conf#L70~L234) file using [Nginx's map directives](https://Nginx.org/en/docs/http/ngx_http_map_module.html#directives).
265
286
266
287
I keep all configurations in very simple variables. You can also make your own version from this base.
267
288
@@ -347,6 +368,7 @@ I keep all configurations in very simple variables. You can also make your own v
347
368
348
369
> **`$imgproxy_preset`**<br/>
349
370
> Define `imgproxy` options for each preset name.
371
+
> You can view more details by following [their documentation](https://docs.imgproxy.net/generating_the_url?id=processing-options).
350
372
> ```nginx
351
373
> map $preset_name $imgproxy_preset
352
374
> {
@@ -365,6 +387,26 @@ I keep all configurations in very simple variables. You can also make your own v
365
387
> ```
366
388
367
389
390
+
> **`$imgproxy_preset_query` (overriding presets with query string)**<br/>
391
+
> Override the `$imgproxy_preset` whenever `width` or `height` provided.
392
+
> But beware that dynamic image sizes are able to cause a denial-of-service attack by allowing an attacker to request multiple different image resizes.
## **`$imgproxy_preset_query` (overriding presets with query string)**
167
+
## Override the `$imgproxy_preset` whenever `width` or `height` provided.
168
+
## But beware that dynamic image sizes are able to cause a denial-of-service attack by allowing an attacker to request multiple different image resizes.
0 commit comments