-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.conf
60 lines (44 loc) · 1.02 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
53
54
55
56
57
58
59
60
daemon off;
error_log /dev/stdout info;
events {
worker_connections 1024;
}
http {
# accept header'inda webp varsa
map $http_accept $is_webp {
default "no";
"~*webp" "yes";
}
#80. porrttan index.html sunuluyor
server {
listen 80;
}
#8080'den nginx small_light modulu calisan bir hali calisiyor
server {
listen 8080;
small_light on;
small_light_getparam_mode on;
}
server {
listen 8081;
small_light on;
location ~ small_light[^/]*/(.+)$ {
set $file $1;
rewrite ^ /$file;
}
}
server {
listen 8090;
resolver 8.8.8.8;
location ~ ^/(.+)$ {
if ($is_webp = "yes") {
proxy_pass http://127.0.0.1:8081/small_light(of=webp,q=75)/$request_uri;
break;
}
if ($is_webp = "no") {
proxy_pass http://127.0.0.1:8080/$request_uri;
break;
}
}
}
}