server {
    listen 80 default_server;
    server_name localhost;
    root /var/www/html/public;

    error_log  /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;
    
    location / {
        try_files $uri /index.php?$query_string;
        index index.html index.htm index.php;
    }

    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass php:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        include fastcgi_params;
    }

    location ~* \.(exe|chb|zip)$ {
        expires max;
    }

    location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|mp3|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|tgz|gz|rar|bz2|doc|xls|ppt|tar|mid|midi|wav|bmp|rtf)$ {
        access_log off;
        log_not_found off;
        expires max;
    }
}
