-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
52 lines (41 loc) · 1.13 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=resized:10m max_size=256m inactive=1h use_temp_path=off;
upstream fastcgi_backend {
server unix:/var/run/php/php7.1-fpm.sock;
}
server {
listen 80;
set $MAGE_ROOT /var/www/html;
set $MAGE_MODE default; # development or production
access_log /var/log/nginx/magento.dev-access.log;
error_log /var/log/nginx/magento.dev-error.log;
include /var/www/html/nginx.conf.sample;
}
# https://github.com/sergejmueller/sergejmueller.github.io/wiki/Nginx:-Real-time-image-resizing-and-caching
server {
## LISTEN
listen 9001;
## SECURITY
allow 127.0.0.1;
deny all;
## ROOT
root /var/www/html;
## RESIZE
location / {
set $w "-";
set $h "-";
set $q "100";
if ( $arg_w ) {
set $w $arg_w;
}
if ( $arg_h ) {
set $h $arg_h;
}
if ( $arg_q ) {
set $q $arg_q;
}
image_filter resize $w $h;
image_filter_jpeg_quality $q;
image_filter_buffer 10M;
image_filter_interlace on;
}
}