Add nginx conf to moinmoin role
parent
9ed6b68f55
commit
4be7621670
|
@ -0,0 +1,6 @@
|
||||||
|
#!/usr/bin/env ansible-playbook
|
||||||
|
---
|
||||||
|
# Deploy MoinMoin Wiki
|
||||||
|
- hosts: kiwi.adm.crans.org
|
||||||
|
roles:
|
||||||
|
- moinmoin
|
|
@ -4,7 +4,7 @@
|
||||||
name: uwsgi
|
name: uwsgi
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
- name: Restart NGINX
|
- name: Restart nginx
|
||||||
service:
|
service:
|
||||||
name: nginx
|
name: nginx
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -36,6 +36,19 @@
|
||||||
enabled: true
|
enabled: true
|
||||||
state: started
|
state: started
|
||||||
|
|
||||||
|
- name: Configure nginx
|
||||||
|
template:
|
||||||
|
src: nginx/sites-available/wiki.j2
|
||||||
|
dest: /etc/nginx/sites-available/wiki
|
||||||
|
notify: Restart nginx
|
||||||
|
|
||||||
|
- name: Activate uwsgi site
|
||||||
|
file:
|
||||||
|
src: /etc/nginx/sites-available/wiki
|
||||||
|
dest: /etc/nginx/sites-enabled/wiki
|
||||||
|
state: link
|
||||||
|
notify: Restart nginx
|
||||||
|
|
||||||
- name: Indicate role in motd
|
- name: Indicate role in motd
|
||||||
template:
|
template:
|
||||||
src: update-motd.d/05-service.j2
|
src: update-motd.d/05-service.j2
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
{{ ansible_header | comment }}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen wiki.adm.crans.org:80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name wiki.crans.org wiki.adm.crans.org;
|
||||||
|
|
||||||
|
access_log /var/log/nginx/wiki.log combined;
|
||||||
|
error_log /var/log/nginx/wiki.error.log;
|
||||||
|
|
||||||
|
# Redirect to home page
|
||||||
|
rewrite ^/$ $scheme://wiki.crans.org/PageAccueil;
|
||||||
|
|
||||||
|
# Limit uploads
|
||||||
|
client_max_body_size 15M;
|
||||||
|
|
||||||
|
# MoinMoin paths
|
||||||
|
location /wiki/ { alias /var/local/moin_htdocs_crans/; }
|
||||||
|
location /robots.txt { alias /var/local/wiki/robots.txt; }
|
||||||
|
location /favicon.ico { alias /var/local/wiki/favicon.ico; }
|
||||||
|
location /www-sitemap.xml { alias /var/local/wiki/www-sitemap.xml; }
|
||||||
|
|
||||||
|
location / {
|
||||||
|
uwsgi_pass unix:///var/run/uwsgi/app/moinmoin/socket;
|
||||||
|
include uwsgi_params;
|
||||||
|
}
|
||||||
|
|
||||||
|
set_real_ip_from 10.231.136.0/24;
|
||||||
|
set_real_ip_from 2a0c:700:0::/48;
|
||||||
|
set_real_ip_from 185.230.76.0/22; #filaire publique
|
||||||
|
set_real_ip_from 10.53.0.0/16; #nat des machines wifi crans
|
||||||
|
set_real_ip_from 10.54.0.0/16; #nat des machines filaires crans
|
||||||
|
real_ip_header X-Real-Ip;
|
||||||
|
}
|
Loading…
Reference in New Issue