Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ops
/
yoho-ansible-roles
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
chunhua.zhang
6 years ago
Commit
0239d3a46c20b611cb53c3d5f1160959baf1c65a
1 parent
76bb9f62
合并ufo的nginx到java的nginx
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
140 additions
and
3 deletions
playbooks/domain.switch.pch5.yml
playbooks/domain.switch.ufo.yml
roles/openresty/files/java-nginx-config/nginx/conf/vhosts/api.ufo.conf
roles/openresty/files/java-nginx-config/nginx/conf/vhosts/platform.ufo.conf
roles/openresty/templates/nginx.conf.j2
playbooks/domain.switch.pch5.yml
View file @
0239d3a
...
...
@@ -8,7 +8,8 @@
prompt
:
"
Start
to
change
.
Please
Enter
YES
to
continue."
private
:
no
-
name
:
"
switch_to_where"
prompt
:
"
switch
to
qcloud,
please
enter
[qq],
switch
to
aws,
enter
[aws]"
prompt
:
"
Please
choose
pch5
endpoint:
[qq|aws]"
default
:
qq
private
:
no
vars_files
:
...
...
playbooks/domain.switch.ufo.yml
View file @
0239d3a
...
...
@@ -8,7 +8,7 @@
prompt
:
"
Start
to
change
.
Please
Enter
YES
to
continue."
private
:
no
-
name
:
"
switch_to_where"
prompt
:
"
switch
to
qcloud,
please
enter
[qq],
switch
to
aws,
enter
[
aws]"
prompt
:
"
Please
choose
ufo
endpoint:
[qq|
aws]"
private
:
no
vars_files
:
...
...
roles/openresty/files/java-nginx-config/nginx/conf/vhosts/api.ufo.conf
0 → 100644
View file @
0239d3a
server
{
listen
80
backlog
=
8192
;
## for proxy
proxy_http_version
1
.
1
;
proxy_set_header
Connection
""
;
server_name
2
.
yohobuy
.
com
ufoapi
.
yohoops
.
org
;
access_log
/
Data
/
logs
/
nginx
/
ufo_access
.
log
fenxi
;
error_log
/
Data
/
logs
/
nginx
/
ufo_error
.
log
;
set
$
real_ip
""
;
set
$
request_api_method
"-"
;
set
$
request_udid
"-"
;
set
$
request_uid
"-"
;
# set_by_lua_file $real_ip conf/setup.lua;
# access_by_lua_file 'conf/lua/limit_api_flow.lua';
#################### reject http HEAD & status check / .ico quest #########
# HEAD REQUEST RETURN 405
if
( $
request_method
=
HEAD
) {
return
200
;
}
# nginx status check
location
= /
status_check
{
default_type
text
/
html
;
return
200
'server is ok!'
;
}
# cdn check
location
= /
test
.
html
{
return
200
;
}
location
= /
favicon
.
ico
{
log_not_found
off
;
access_log
off
;
}
#################### begin match 2.yohobuy.com #########################
# location / {
# rewrite_by_lua_file conf/redirect.lua;
# }
#################### end match 2.yohobuy.com #########################
location
/ {
limit_req
zone
=
limit_ufo
burst
=
10
nodelay
;
proxy_redirect
off
;
proxy_pass
http
://
ufogateway
/
ufo
-
gateway
/;
proxy_set_header
X
-
Real
-
IP
$
real_ip
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
Accept
-
Encoding
"gzip"
;
proxy_http_version
1
.
1
;
proxy_set_header
Connection
""
;
proxy_set_header
Host
$
host
;
}
# forward to node app
location
^~ /
mapp
/ {
proxy_redirect
off
;
proxy_pass
http
://
10
.
66
.
16
.
6
/
mapp
/;
proxy_set_header
Host
"2.yohobuy.com"
;
proxy_set_header
X
-
Real
-
IP
$
remote_addr
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
Accept
-
Encoding
"gzip"
;
}
location
~* .(
txt
)$ {
root
/
Data
/
local
/
openresty
-
1
.
9
.
15
.
1
/
nginx
/
html
;
}
}
...
...
roles/openresty/files/java-nginx-config/nginx/conf/vhosts/platform.ufo.conf
0 → 100644
View file @
0239d3a
server
{
listen
80
;
server_name
admin
.
ufo
.
yohobuy
.
com
;
#charset koi8-r;
access_log
/
Data
/
logs
/
nginx
/
access_admin
.
ufo
.
yohobuy
.
com
.
log
fenxi
;
# only allow for office access
allow
218
.
94
.
75
.
58
;
allow
218
.
94
.
75
.
50
;
allow
218
.
94
.
77
.
166
;
allow
106
.
38
.
38
.
146
;
allow
106
.
39
.
86
.
227
;
allow
106
.
39
.
86
.
228
;
allow
106
.
39
.
86
.
226
;
allow
106
.
38
.
38
.
147
;
allow
172
.
31
.
0
.
0
/
16
;
allow
10
.
66
.
0
.
0
/
16
;
deny
all
;
location
^~ /
ufoPlatform
/ {
proxy_redirect
off
;
proxy_pass
http
://
ufoplatform
/
ufoPlatform
/;
proxy_set_header
Host
"admin.ufo.yohobuy.com"
;
proxy_set_header
X
-
Real
-
IP
$
remote_addr
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
Accept
-
Encoding
"gzip"
;
}
}
...
...
roles/openresty/templates/nginx.conf.j2
View file @
0239d3a
...
...
@@ -188,7 +188,27 @@ http
keepalive 100;
}
#ufo-gateway
upstream ufogateway {
{% for i in groups['java-ufo-fore'] %}
server {{ i }}:8080 max_fails=5 fail_timeout=3s;
{% endfor %}
keepalive 32;
}
# ufo-gateway
upstream ufoplatform {
{% for i in groups['java-ufo-platform'] %}
server {{ i }}:8088 max_fails=5 fail_timeout=3s;
{% endfor %}
keepalive 100;
}
#upstream
fastcgi_next_upstream error timeout invalid_header http_500;
...
...
Please
register
or
login
to post a comment