This repository has been archived by the owner on Oct 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
executable file
·114 lines (85 loc) · 2.41 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
error_log stderr notice;
daemon off;
events { }
http {
include /usr/local/openresty/nginx/conf/mime.types;
server {
listen 6789;
lua_code_cache off;
location @image_server {
content_by_lua_file "serve_image.lua";
}
location ~ ^/images/(?<sig>[^/]+)/(?<size>[^/]+)/(?<path>.*\.(?<ext>[a-z_]*))$ {
#location ~ ^/images?(?<sig>[^/]+)&(?<size>[^/]+)/(?<path>.*\.(?<ext>[a-z_]*))$ {
root cache;
set_md5 $digest "$size/$path";
#try_files /$sig.$ext @image_server;
try_files /$digest.$ext @image_server;
}
# This is a debug location that we can use to generate valid signed urls
location ~ ^/gen/.*$ {
content_by_lua_file "gen_url.lua";
}
location ~ /test{
content_by_lua_file "test.lua";
#content_by_lua_file "test1.lua";
}
location ~ /crop{
content_by_lua_file "crop.lua";
}
location ~ /img-p{
content_by_lua_file "img-process.lua";
}
location @image_server_test {
content_by_lua_file "serve_image_test.lua";
}
location ~ /check/(?<path>.*\.(?<ext>[a-z_]*))$ {
root cache;
#set_md5 $digest "$size/$path";
#try_files /$digest.$ext @image_server_test;
try_files /$arg_image.$ext @image_server_test;
}
location @image_server_ {
content_by_lua_file "img-process.lua";
}
location ~ /image-processing/(?<path>.*\.(?<ext>[a-z_]*))$ {
root cache;
try_files /$arg_image.$ext @image_server_;
}
location @image_server__ {
content_by_lua_file "img-process.lua";
}
location ~ /img/(?<path>.*\.(?<ext>[a-z_]*))$ {
root cache;
try_files /$arg_image.$ext @image_server__;
}
location ~ /bash{
content_by_lua_file "bash.lua";
}
location ~ /api{
content_by_lua_file "api.lua";
}
location ~ /upload{
content_by_lua_file "upload_server.lua";
}
location ~ /image-upload{
content_by_lua_file "upload_image.lua";
}
location /save {
content_by_lua_file upload.lua;
}
location ~ ^/users/(.+\.(?:gif|jpe?g|png))$ {
root html/user-uploaded-images;
try_files /$1 @not_found;
}
location ~ ^/products/(.+\.(?:gif|jpe?g|png))$ {
root html/product-images;
try_files /$1 @not_found;
}
location @not_found {
content_by_lua '
ngx.say("<p>Not found</p>")
';
}
}
}