-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathnginx.conf
More file actions
116 lines (101 loc) · 3.21 KB
/
Copy pathnginx.conf
File metadata and controls
116 lines (101 loc) · 3.21 KB
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
115
116
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
client_max_body_size 50M;
client_header_buffer_size 512k;
large_client_header_buffers 4 512k;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
## Gzip Settings
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 32 4k;
gzip_min_length 5k;
gzip_types text/plain text/css text/xml text/javascript application/javascript application/json application/x-javascript application/xml application/rss+xml application/xhtml+xml application/atom_xml application/x-httpd-php application/vnd.ms-fontobject font/ttf font/opentype font/x-woff image/jpeg image/gif image/png image/svg+xml;
## Gzip end
upstream oserver{
server 127.0.0.1:8069;
}
upstream lserver{
server 127.0.0.1:8072;
}
server {
listen 80;
server_name www.* ;
proxy_cache off;
location /{
proxy_pass http://oserver;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
proxy_connect_timeout 60;
proxy_send_timeout 60;
proxy_read_timeout 3000;
}
location /longpolling{
proxy_pass http://lserver;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
proxy_connect_timeout 60;
proxy_send_timeout 60;
proxy_read_timeout 3000;
}
location ~* /[a-zA-Z0-9_-]*/static/ {
proxy_pass http://oserver;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
proxy_connect_timeout 60;
proxy_send_timeout 60;
proxy_read_timeout 3000;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
## 认证文件,按实际文件名
location /WW_verify_wechat.txt {
root /usr/share/nginx/html;
default_type text/html;
}
}
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}