dev/provisioning/files/site.j2
author ymh <ymh.work@gmail.com>
Tue, 23 Jun 2015 17:01:39 +0200
changeset 2 00e2916104fe
parent 1 01a844d292ac
child 4 f55970e41793
permissions -rw-r--r--
Migrate to php 5.6 + Laravel 5.1 + add phpunit test

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;

events {
    worker_connections  1024;
}

http {

    server {
        listen 80;
        server_name {{ site_name }};
        root /code/src/public;

        index index.html index.htm index.php;

        charset utf-8;

        location / {
            try_files $uri $uri/ /index.php?$query_string;
        }

        location = /favicon.ico { access_log off; log_not_found off; }
        location = /robots.txt  { access_log off; log_not_found off; }

        access_log off;
        error_log  /var/log/nginx/{{ site_name }}-error.log error;

        sendfile off;

        client_max_body_size 100m;

        location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/opt/remi/php56/root/var/run/php-fpm/php-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
            fastcgi_param PATH_TRANSLATED $document_root/$fastcgi_script_name;
            fastcgi_intercept_errors off;
            fastcgi_buffer_size 16k;
            fastcgi_buffers 4 16k;
        }

        location ~ /\.ht {
            deny all;
        }
    }
    server {
        listen 443;
        server_name {{ site_name }};
        root /code/src/public;

        index index.html index.htm index.php;

        charset utf-8;

        location / {
            try_files $uri $uri/ /index.php?$query_string;
        }

        location = /favicon.ico { access_log off; log_not_found off; }
        location = /robots.txt  { access_log off; log_not_found off; }

        access_log off;
        error_log  /var/log/nginx/{{ site_name }}-ssl-error.log error;

        sendfile off;

        client_max_body_size 100m;

        location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/opt/remi/php56/root/var/run/php-fpm/php-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
            fastcgi_param PATH_TRANSLATED $document_root/$fastcgi_script_name;
            fastcgi_intercept_errors off;
            fastcgi_buffer_size 16k;
            fastcgi_buffers 4 16k;
        }

        location ~ /\.ht {
            deny all;
        }

        ssl on;
        ssl_certificate     /etc/nginx/ssl/{{ site_name }}.crt;
        ssl_certificate_key /etc/nginx/ssl/{{ site_name }}.key;
    }

}