dev/provisioning/files/site.j2
changeset 28 b0b56e0f8c7f
parent 27 a2342f26c9de
child 29 50702e620af4
equal deleted inserted replaced
27:a2342f26c9de 28:b0b56e0f8c7f
     1 #user  nobody;
       
     2 worker_processes  1;
       
     3 
       
     4 #error_log  logs/error.log;
       
     5 #error_log  logs/error.log  notice;
       
     6 #error_log  logs/error.log  info;
       
     7 
       
     8 #pid        logs/nginx.pid;
       
     9 
       
    10 events {
       
    11     worker_connections  1024;
       
    12 }
       
    13 
       
    14 http {
       
    15 
       
    16     include       mime.types;
       
    17     default_type  application/octet-stream;
       
    18 
       
    19     server {
       
    20         listen 80;
       
    21         server_name {{ site_name }};
       
    22         root /code/src/public;
       
    23 
       
    24         index index.html index.htm index.php;
       
    25 
       
    26         charset utf-8;
       
    27 
       
    28         location / {
       
    29             try_files $uri $uri/ /index.php?$query_string;
       
    30         }
       
    31 
       
    32         location = /favicon.ico { access_log off; log_not_found off; }
       
    33         location = /robots.txt  { access_log off; log_not_found off; }
       
    34 
       
    35         access_log off;
       
    36         error_log  /var/log/nginx/{{ site_name }}-error.log error;
       
    37 
       
    38         sendfile off;
       
    39 
       
    40         client_max_body_size 100m;
       
    41 
       
    42         location ~ \.php$ {
       
    43             fastcgi_split_path_info ^(.+\.php)(/.+)$;
       
    44             fastcgi_pass unix:/opt/remi/php56/root/var/run/php-fpm/php-fpm.sock;
       
    45             fastcgi_index index.php;
       
    46             include fastcgi_params;
       
    47             fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
       
    48             fastcgi_param PATH_TRANSLATED $document_root/$fastcgi_script_name;
       
    49             fastcgi_intercept_errors off;
       
    50             fastcgi_buffer_size 16k;
       
    51             fastcgi_buffers 4 16k;
       
    52         }
       
    53 
       
    54         location ~ /\.ht {
       
    55             deny all;
       
    56         }
       
    57     }
       
    58     server {
       
    59         listen 443;
       
    60         server_name {{ site_name }};
       
    61         root /code/src/public;
       
    62 
       
    63         index index.html index.htm index.php;
       
    64 
       
    65         charset utf-8;
       
    66 
       
    67         location / {
       
    68             try_files $uri $uri/ /index.php?$query_string;
       
    69         }
       
    70 
       
    71         location = /favicon.ico { access_log off; log_not_found off; }
       
    72         location = /robots.txt  { access_log off; log_not_found off; }
       
    73 
       
    74         access_log off;
       
    75         error_log  /var/log/nginx/{{ site_name }}-ssl-error.log error;
       
    76 
       
    77         sendfile off;
       
    78 
       
    79         client_max_body_size 100m;
       
    80 
       
    81         location ~ \.php$ {
       
    82             fastcgi_split_path_info ^(.+\.php)(/.+)$;
       
    83             fastcgi_pass unix:/opt/remi/php56/root/var/run/php-fpm/php-fpm.sock;
       
    84             fastcgi_index index.php;
       
    85             include fastcgi_params;
       
    86             fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
       
    87             fastcgi_param PATH_TRANSLATED $document_root/$fastcgi_script_name;
       
    88             fastcgi_intercept_errors off;
       
    89             fastcgi_buffer_size 16k;
       
    90             fastcgi_buffers 4 16k;
       
    91         }
       
    92 
       
    93         location ~ /\.ht {
       
    94             deny all;
       
    95         }
       
    96 
       
    97         ssl on;
       
    98         ssl_certificate     /etc/nginx/ssl/{{ site_name }}.crt;
       
    99         ssl_certificate_key /etc/nginx/ssl/{{ site_name }}.key;
       
   100     }
       
   101 
       
   102 }