Add reverse-proxy for Re2o on the portal VM

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
ynerant 2021-01-24 21:20:53 +01:00 committed by ynerant
parent 6df41d16b5
commit 9bd06520fb
Signed by untrusted user: ynerant
GPG key ID: 3A75C55819C8CF85
4 changed files with 51 additions and 5 deletions

View file

@ -0,0 +1,40 @@
---
certbot:
domains:
- portail.auro.re
mail: tech.aurore@lists.crans.org
certname: auro.re
nginx:
ssl:
cert: /etc/letsencrypt/live/auro.re/fullchain.pem
cert_key: /etc/letsencrypt/live/auro.re/privkey.pem
trusted_cert: /etc/letsencrypt/live/auro.re/chain.pem
redirect_dnames: {}
redirect_tcp: {}
redirect_sites:
- from: portail.adm.auro.re
to: portail.auro.re
norequesturi: true
- from: 10.128.0.247
to: portail.auro.re
norequesturi: true
- from: 45.66.111.247
to: portail.auro.re
norequesturi: true
reverseproxy_sites:
- from: portail.auro.re
to: 10.128.0.20
custom_args:
- "allow 45.66.108.251"
- "allow 45.66.108.252"
- "allow 45.66.108.253"
- "allow 45.66.108.254"
- "allow 45.66.108.255"
- "deny all"

View file

@ -9,7 +9,7 @@ server {
server_name {{ site.from }}; server_name {{ site.from }};
location / { location / {
return 302 http://{{ site.to }}$request_uri; return 302 http://{{ site.to }}{% if site.norequesturi is not defined %}$request_uri{% endif %};
} }
} }
@ -24,7 +24,7 @@ server {
include "/etc/nginx/snippets/options-ssl.conf"; include "/etc/nginx/snippets/options-ssl.conf";
location / { location / {
return 302 https://{{ site.to }}$request_uri; return 302 https://{{ site.to }}{% if site.norequesturi is not defined %}$request_uri{% endif %};
} }
} }
@ -43,7 +43,7 @@ server {
server_name {{ from }}; server_name {{ from }};
location / { location / {
return 302 http://{{ site.to }}$request_uri; return 302 http://{{ site.to }}{% if site.norequesturi is not defined %}$request_uri{% endif %};
} }
} }
@ -58,7 +58,7 @@ server {
include "/etc/nginx/snippets/options-ssl.conf"; include "/etc/nginx/snippets/options-ssl.conf";
location / { location / {
return 302 https://{{ site.to }}$request_uri; return 302 https://{{ site.to }}{% if site.norequesturi is not defined %}$request_uri{% endif %};
} }
} }

View file

@ -47,6 +47,12 @@ server {
set_real_ip_from 2a0c:700:0:2::/64; set_real_ip_from 2a0c:700:0:2::/64;
real_ip_header P-Real-Ip; real_ip_header P-Real-Ip;
{% if site.custom_args is defined -%}
{% for arg in site.custom_args %}
{{ arg }};
{% endfor %}
{% endif %}
location / { location / {
proxy_pass http://{{ site.to }}; proxy_pass http://{{ site.to }};
include "/etc/nginx/snippets/options-proxypass.conf"; include "/etc/nginx/snippets/options-proxypass.conf";

View file

@ -11,7 +11,7 @@
- passbolt - passbolt
# Deploy reverse proxy # Deploy reverse proxy
- hosts: proxy*.adm.auro.re - hosts: portail.adm.auro.re,proxy*.adm.auro.re
roles: roles:
- certbot - certbot
- nginx_reverseproxy - nginx_reverseproxy