server {
    client_max_body_size 72m;
    gzip on;
    gzip_buffers 16 8k;
    gzip_comp_level 2;
    gzip_min_length 1024;
    gzip_types text/css text/plain text/json text/x-js text/javascript text/xml application/json application/x-javascript application/xml application/xml+rss application/javascript;
    gzip_disable "msie6";
    gzip_vary on;
    gzip_http_version 1.0;
    listen   80 default_server;
    server_name www.component17.com;
    return 301 https://component17.com$request_uri;

    root /var/www/html/public;
    index index.php index.html index.htm;

    location / {
         try_files $uri $uri/ /index.php$is_args$args;
    }

    # pass the PHP скриптs to FastCGI server listening on /var/run/php5-fpm.sock
    location ~ \.php$ {
            try_files $uri /index.php =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass php:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
}
server {
    client_max_body_size 72m;
    gzip on;
    gzip_buffers 16 8k;
    gzip_comp_level 2;
    gzip_min_length 1024;
    gzip_types text/css text/plain text/json text/x-js text/javascript text/xml application/json application/x-javascript application/xml application/xml+rss application/javascript;
    gzip_disable "msie6";
    gzip_vary on;
    gzip_http_version 1.0;
    listen 443 ssl;

    server_name component17.com;

    ssl_certificate /etc/letsencrypt/live/component17.com/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/component17.com/privkey.pem;
	ssl_trusted_certificate /etc/letsencrypt/live/component17.com/chain.pem;
    
    root /var/www/html/public;
    index index.php index.html index.htm;

    location / {
         try_files $uri $uri/ /index.php$is_args$args;
    }

    # pass the PHP скриптs to FastCGI server listening on /var/run/php5-fpm.sock
    location ~ \.php$ {
            try_files $uri /index.php =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass php:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
}