correction syntaxe
[lhc/ansible.git] / templates / nginx_WP_server.j2
1 server {
2 listen 80;
3 server_name {{ DOMAIN }}.{{ TLD }} {{ config_ss_domain | default(SITE) }}.{{ DOMAIN }}.{{ TLD }};
4 root /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/;
5 access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/access.log main buffer=32k;
6 error_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/error.log warn;
7 {% if ssl_ready is defined and ssl_ready %}
8 return 301 https://$server_name$request_uri;
9 }
10 server {
11 listen 443;
12 ssl_certificate /etc/letsencrypt/live/{{ SITE }}.{{ DOMAIN }}.{{ TLD }}/fullchain.pem;
13 ssl_certificate_key /etc/letsencrypt/live/{{ SITE }}.{{ DOMAIN }}.{{ TLD }}/privkey.pem;
14 access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/access.log main buffer=32k;
15 error_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/error.log warn;
16 root /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/;
17 server_name {{ DOMAIN }}.{{ TLD }} {{ config_ss_domain | default(SITE) }}.{{ DOMAIN }}.{{ TLD }};
18 {% endif %}
19 index index.php index.html index.htm;
20 client_max_body_size 500M;
21 location / {
22 try_files $uri $uri/ /index.php?$args;
23 }
24 location = /favicon.ico {
25 log_not_found off;
26 access_log off;
27 }
28 location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
29 expires max;
30 log_not_found off;
31 }
32 location = /robots.txt {
33 allow all;
34 log_not_found off;
35 access_log off;
36 }
37 location ~ \.php$ {
38 include snippets/fastcgi-php.conf;
39 fastcgi_pass unix:/run/php{{ php_version }}/fpm/php_{{ SIGLE }}_{{ SITE }};
40 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
41 include fastcgi_params;
42 }
43 }