Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
servers-config
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Sistemisti
servers-config
Commits
8d8c8740
Commit
8d8c8740
authored
Mar 02, 2018
by
Pietro Albini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nginx: remove unused stuff and proxy requests to containers
parent
3963c7ec
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
65 additions
and
80 deletions
+65
-80
playbooks/roadhouse.yml
playbooks/roadhouse.yml
+5
-0
roles/nginx/defaults/main.yml
roles/nginx/defaults/main.yml
+3
-0
roles/nginx/handlers/main.yml
roles/nginx/handlers/main.yml
+1
-1
roles/nginx/tasks/main.yml
roles/nginx/tasks/main.yml
+4
-2
roles/nginx/tasks/proxy.yml
roles/nginx/tasks/proxy.yml
+10
-0
roles/nginx/tasks/setup.yml
roles/nginx/tasks/setup.yml
+16
-30
roles/nginx/templates/conf.d/optimize.conf
roles/nginx/templates/conf.d/optimize.conf
+4
-2
roles/nginx/templates/config/nginx.conf
roles/nginx/templates/config/nginx.conf
+0
-45
roles/nginx/templates/firewall.sh
roles/nginx/templates/firewall.sh
+5
-0
roles/nginx/templates/sites/default.conf
roles/nginx/templates/sites/default.conf
+4
-0
roles/nginx/templates/sites/proxied.conf
roles/nginx/templates/sites/proxied.conf
+13
-0
No files found.
playbooks/roadhouse.yml
View file @
8d8c8740
...
...
@@ -23,6 +23,11 @@
-
role
:
nginx
proxy
:
code.ubuntu-it.org
:
spock.lxd:80
wwwtest.ubuntu-it.org
:
bromuro.lxd:80
votantonio.ubuntu-it.org
:
bromuro.lxd:80
-
role
:
lxd
subnet4
:
10.0.0
...
...
roles/nginx/defaults/main.yml
0 → 100644
View file @
8d8c8740
---
proxy
:
{}
roles/nginx/handlers/main.yml
View file @
8d8c8740
---
-
name
:
web-server.reload-nginx
-
name
:
nginx.reload
service
:
name
:
nginx
state
:
reloaded
roles/nginx/tasks/main.yml
View file @
8d8c8740
---
-
name
:
setup
include
:
setup.yml
-
include_tasks
:
setup.yml
-
include_tasks
:
proxy.yml
when
:
proxy
roles/nginx/tasks/proxy.yml
0 → 100644
View file @
8d8c8740
---
-
name
:
Upload configuration for proxied sites
template
:
src
:
sites/proxied.conf
dest
:
"
/etc/nginx/sites-enabled/{{
item.key
}}"
with_dict
:
"
{{
proxy
}}"
notify
:
-
nginx.reload
roles/nginx/tasks/setup.yml
View file @
8d8c8740
---
-
name
:
i
nstall nginx
-
name
:
I
nstall nginx
apt
:
name
:
"
{{
item
}}"
state
:
present
...
...
@@ -9,47 +9,33 @@
-
nginx
-
name
:
create directories for nginx
file
:
path
:
"
/etc/nginx/{{
item
}}"
state
:
directory
mode
:
0755
with_items
:
-
sites
-
name
:
Upload nginx configuration files
template
:
src
:
"
conf.d/{{
item
}}"
dest
:
"
/etc/nginx/conf.d/{{
item
}}"
-
name
:
remove unused nginx directories
file
:
path
:
"
{{
item
}}"
state
:
absent
mode
:
0644
with_items
:
-
/var/www/html
-
/etc/nginx/sites-available
-
/etc/nginx/sites-enabled
-
optimize.conf
-
name
:
upload nginx configuration files
template
:
src
:
"
config/{{
item
}}"
dest
:
"
/etc/nginx/{{
item
}}"
notify
:
-
nginx.reload
mode
:
0644
with_items
:
-
nginx.conf
-
conf.d/default-site
.conf
-
conf.d/optimize.conf
-
name
:
Upload default site
template
:
src
:
sites/default
.conf
dest
:
/etc/nginx/sites-enabled/default
notify
:
-
web-server.reload-nginx
-
nginx.reload
-
name
:
a
llow http through the firewall
-
name
:
A
llow http through the firewall
template
:
src
:
firewall.sh
dest
:
/usr/local/share/firewall.d/
web-server
.sh
dest
:
/usr/local/share/firewall.d/
nginx
.sh
mode
:
0700
notify
:
...
...
roles/nginx/templates/conf
ig/conf
.d/optimize.conf
→
roles/nginx/templates/conf.d/optimize.conf
View file @
8d8c8740
#
# {{ ansible_managed }}
#
######################
# gzip compression #
######################
gzip
on
;
gzip_disable
"msie6"
;
gzip_vary
on
;
gzip_comp_level
6
;
...
...
roles/nginx/templates/config/nginx.conf
deleted
100644 → 0
View file @
3963c7ec
user
www-data
;
worker_processes
auto
;
pid
/run/nginx.pid
;
events
{
worker_connections
768
;
}
http
{
####################
# Basic Settings #
####################
sendfile
on
;
tcp_nopush
on
;
tcp_nodelay
on
;
keepalive_timeout
65
;
types_hash_max_size
2048
;
server_tokens
off
;
include
/etc/nginx/mime.types
;
default_type
application/octet-stream
;
#######################
# SSL configuration #
#######################
ssl_protocols
TLSv1
TLSv1.1
TLSv1.2
;
ssl_prefer_server_ciphers
on
;
########################
# Logs configuration #
########################
access_log
/var/log/nginx/access.log
;
error_log
/var/log/nginx/error.log
;
#########################
# Extra configuration #
#########################
include
/etc/nginx/conf.d/*.conf
;
include
/etc/nginx/sites/*
;
}
roles/nginx/templates/firewall.sh
View file @
8d8c8740
#!/bin/bash
#
# {{ ansible_managed }}
#
# Allow incoming requests on port 80
command
-A
public_input_tcp
-p
tcp
--dport
80
-j
ACCEPT
roles/nginx/templates/
config/conf.d/default-site
.conf
→
roles/nginx/templates/
sites/default
.conf
View file @
8d8c8740
#
# {{ ansible_managed }}
#
server
{
listen
80
default
;
listen
[::]:
80
default
;
...
...
roles/nginx/templates/sites/proxied.conf
0 → 100644
View file @
8d8c8740
#
# {{ ansible_managed }}
#
server
{
listen
80
;
listen
[::]:
80
;
server_name
{{
item
.
key
}};
location
/ {
proxy_pass
http
://{{
item
.
value
}}/;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment