user  www-data;
worker_processes  auto;

events {
    worker_connections  1024;
}

http {
    sendfile on;
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    server {
        listen 80;
        server_name localhost;
        root /var/www/html/public;
        index index.php index.html;

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

        location ~ \.php$ {
            include fastcgi_params;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }

        location ~* \.(jpg|jpeg|png|gif|css|js|ico|svg)$ {
            try_files $uri $uri/ =404;
            access_log off;
            expires max;
        }

        location ~ /\.ht {
            deny all;
        }

        types {
            text/css                             css;
            application/javascript               js;
            application/json                     json;
            image/png                            png;
            image/jpeg                           jpeg jpg;
            image/webp                           webp;
            image/gif                            gif;
            image/svg+xml                        svg svgz;
            font/woff                            woff;
            font/woff2                           woff2;
            font/ttf                             ttf;
            font/otf                             otf;
            application/vnd.ms-fontobject       eot;
            text/plain                           txt;
            application/xml                      xml;
            application/pdf                      pdf;
            application/zip                      zip;
            application/gzip                     gz;
        }

        error_log /var/log/nginx/error.log;
        access_log /var/log/nginx/access.log;
    }
}
