File tree Expand file tree Collapse file tree 2 files changed +59
-2
lines changed Expand file tree Collapse file tree 2 files changed +59
-2
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ user www www;
2+ worker_processes 4;
3+ worker_cpu_affinity 1000 0100 0010 0001 ;
4+ error_log /opt/logs/nginx/error.log error;
5+ pid /var/run/nginx.pid ;
6+ worker_rlimit_nofile 65535 ;
7+ events
8+ {
9+ use epoll;
10+ worker_connections 65535 ;
11+ }
12+ http
13+ {
14+ limit_conn_zone $binary_remote_addr zone =one:10m ;
15+ limit_conn_zone $server_name zone =perserver:10m ;
16+ include mime.types ;
17+ include fastcgi.conf;
18+ default_type application/octet-stream ;
19+ charset utf-8;
20+ server_names_hash_bucket_size 128 ;
21+ client_header_buffer_size 32k ;
22+ large_client_header_buffers 4 64k ;
23+ sendfile on;
24+ autoindex off;
25+ tcp_nopush on;
26+ tcp_nodelay on;
27+ keepalive_timeout 120 ;
28+
29+
30+ fastcgi_connect_timeout 60 ;
31+ fastcgi_send_timeout 60 ;
32+ fastcgi_read_timeout 60 ;
33+ fastcgi_buffer_size 128k ;
34+ fastcgi_buffers 8 128k ;
35+ fastcgi_busy_buffers_size 128k ;
36+ fastcgi_temp_file_write_size 128k ;
37+
38+
39+ gzip on;
40+ gzip_min_length 1k ;
41+ gzip_buffers 4 16k ;
42+ gzip_http_version 1.0;
43+ gzip_comp_level 2;
44+ gzip_types text/plain application/x-javascript text/css application/xml;
45+ gzip_vary on;
46+
47+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
48+ '$status $body_bytes_sent "$http_referer" '
49+ '"$http_user_agent" $http_x_forwarded_for' ;
50+
51+ client_max_body_size 200m ;
52+
53+ #lua_package_path "/etc/nginx/lua/?.lua";
54+
55+ include /etc/nginx/vhost/*.conf;
56+ }
57+
Original file line number Diff line number Diff line change @@ -16,11 +16,12 @@ server {
1616 content_by_lua 'ngx.say("hello, ttlsa lua")';
1717 }
1818
19- #/thumbnail目录下的图片请求不经过缩略图模块
19+ #/thumb目录下的图片请求不经过缩略图模块
2020 location ^~ /thumb/ {
2121
2222 }
2323
24+ # 所有符合规则的图片/xx/xx/xx.jpg_100x100.jpg
2425 location ~* ^(.+\.(jpg|jpeg|gif|png))_(\d+)+x(\d+)+\.(jpg|jpeg|gif|png)$ {
2526 root $root_path; # 这里必须设置,否则根目录,即 $document_root 会是 Nginx 默认的 Nginx Root/html,在 Lua 中会得不到期望的值
2627 set $thumbnail_root $root_path/thumb;
You can’t perform that action at this time.
0 commit comments