diff --git a/host_vars/web2.dmz.mateu.be.yml b/host_vars/web2.dmz.mateu.be.yml index 7a84757..165981b 100644 --- a/host_vars/web2.dmz.mateu.be.yml +++ b/host_vars/web2.dmz.mateu.be.yml @@ -5,6 +5,7 @@ web_hostname: - analyse.nintendojo.fr - nintendojo.fr - www.nintendojo.fr + - wwwdev.nintendojo.fr - forum.nintendojo.fr - nintendojofr.com - www.nintendojofr.com diff --git a/roles/nginx/templates/vhosts/wwwdev.nintendojo.fr.conf.j2 b/roles/nginx/templates/vhosts/wwwdev.nintendojo.fr.conf.j2 new file mode 100644 index 0000000..1f35b77 --- /dev/null +++ b/roles/nginx/templates/vhosts/wwwdev.nintendojo.fr.conf.j2 @@ -0,0 +1,44 @@ +## WP NintendojoFR +server { +{% include './templates/header.conf.j2' %} + + root /srv/http/wwwdev.nintendojo.fr/; + index index.html index.htm index.php; + + client_max_body_size 2G; + + # couper les fichiers cachés + location ~* /(?:uploads|files)/.*\.php$ { + deny all; + } + + # couper les fichiers textes du captcha + location ~* /wp-content/uploads/wpcf7_captcha/.*\.txt$ { + deny all; + } + + # redirige twitter + location /feed/twitter { + return 307 https://m.nintendojo.fr/@nintendojofr.rss; + } + + # Interprétation PHP + location ~ ^/(index).php(/.*)+ { + fastcgi_split_path_info ^(.+\.php)(/.*)$; + try_files $fastcgi_script_name =404; + fastcgi_pass unix:/var/run/php/php{{ php_version }}-fpm.sock; + fastcgi_read_timeout 60; + include fastcgi_params; + } + + location ~ \.php$ { + try_files $uri $uri/ =404; + fastcgi_pass unix:/var/run/php/php{{ php_version }}-fpm.sock; + fastcgi_read_timeout 60; + include fastcgi_params; + } + + location / { + try_files $uri $uri/ /index.php$uri?$args; + } +}