-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf.back
81 lines (74 loc) · 2.51 KB
/
nginx.conf.back
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
user service;
worker_processes 1;
pid /home/service/nginx/log/nginx.pid;
worker_rlimit_nofile 40960;
events {
use epoll;
worker_connections 1024;
}
http {
#include mime.types;
default_type application/octet-stream;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name ws.o-topcy.com;
access_log /home/service/nginx/log/access.log;
error_log /home/service/nginx/log/error.log;
location / {
root /home/service/nginx/html;
index index.html index.htm;
}
#must has '/' at last
location /ws/ {
#must has '/' at last
proxy_pass http://localhost:5002/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /httproute {
proxy_pass http://localhost:5003;
}
location /imgs {
alias /home/service/nginx/html/myimg;
}
location /vedios {
alias /home/service/nginx/html/vedio;
}
location ~* ^/resize {
root /data/site_cache/$server_name;
set $width 150;
set $height 100;
set $dimens "";
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) {
set $width $1;
set $height $2;
set $image_path $3;
set $demins "_$1x$2";
}
if ($uri ~* "^/resize/(.*)" ) {
set $image_path $1;
}
set $image_uri image_resize/$image_path?width=$width&height=$height;
if (!-f $request_filename) {
proxy_pass http://127.0.0.1/$image_uri;
break;
}
proxy_store /data/site_cache/$server_name/resize$demins/$image_path;
proxy_store_access user:rw group:rw all:r;
proxy_set_header Host $host;
expires 30d;
access_log off;
}
location /image_resize {
alias /data/site/$server_name/;
image_filter resize $arg_width $arg_height;
image_filter_jpeg_quality 75;
access_log off;
}
}
}