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
Your Name
5 years ago
Commit
be61c5c87d04756e5b93ee2f4b2b4d2e0aba7afc
1 parent
b3263d28
添加action.yoho.cn/admin的IP访问限制
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletions
playbooks/templates/web-nginx/vhosts/action.yohocn.conf
playbooks/web-nginx.yml
playbooks/templates/web-nginx/vhosts/action.yohocn.conf
View file @
be61c5c
...
...
@@ -25,6 +25,21 @@ server {
proxy_set_header
X
-
Forwarded
-
For
$
http_x_forwarded_for
;
proxy_set_header
Accept
-
Encoding
"gzip"
;
}
location
/
admin
/ {
{%
for
item
in
yoho_office_ips
%}
allow
{{
item
}};
{%
endfor
%}
deny
all
;
proxy_redirect
off
;
proxy_pass
http
://
yoho
-
web
-
new
-
inner
;
proxy_set_header
Host
$
host
;
proxy_set_header
X
-
Real
-
IP
$
http_x_forwarded_for
;
proxy_set_header
X
-
Yoho
-
Real
-
IP
$
http_x_forwarded_for
;
proxy_set_header
X
-
Forwarded
-
For
$
http_x_forwarded_for
;
proxy_set_header
Accept
-
Encoding
"gzip"
;
}
location
/
api
/ {
...
...
@@ -38,4 +53,4 @@ server {
proxy_set_header
X
-
Forwarded
-
For
$
http_x_forwarded_for
;
proxy_set_header
Accept
-
Encoding
"gzip"
;
}
}
\ No newline at end of file
}
...
...
playbooks/web-nginx.yml
View file @
be61c5c
---
-
hosts
:
web-nginx
remote_user
:
root
vars_files
:
-
extra_vars/all.yml
vars_prompt
:
-
name
:
"
confirmation"
prompt
:
"
Sync
and
reload
java
nginx.
Please
Enter
[YES]
to
continue"
...
...
Please
register
or
login
to post a comment