-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnginx.conf
86 lines (79 loc) · 2.81 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
user www www;
worker_processes 1;
error_log /var/log/nginx_error.log info;
pid /var/log/nginx.pid;
events {
worker_connections 128;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_min_length 1k;
gzip_buffers 16 64k;
gzip_http_version 1.1;
gzip_comp_level 6;
gzip_types text/plain application/x-javascript text/css application/xml;
proxy_connect_timeout 30;
proxy_send_timeout 30;
proxy_read_timeout 60;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
proxy_max_temp_file_size 128m;
proxy_temp_path /var/log/nginx_proxy_cache/temp;
#keys_zone is cache key
proxy_cache_path /var/log/nginx_proxy_cache/cache levels=1:2 keys_zone=nginx_proxy_cache:5m inactive=1d max_size=20g;
server {
listen 80;
server_name r.sparrowzoo.net;
location / {
root /workspace/sparrow-js/assets;
expires 10d;
}
}
upstream tomcat{
server 127.0.0.1:7777;
}
server{
listen 80;
server_name www.sparrowzoo.com sparrowzoo.com;
charset utf_8;
index /;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
location /{
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 50m;
client_body_buffer_size 256k;
expires 10m;
proxy_pass http://tomcat;
}
}
upstream lottery{
server 127.0.0.1:9999;
}
server{
listen 80;
server_name lottery.sparrowzoo.com;
charset utf_8;
index /;
location /{
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 50m;
add_header Cache-Control no-store;
proxy_pass http://lottery;
}
}
}