Sample laravel nginx config

server {
        listen       80;
        listen       [::]:80;

        # listen      443 ssl http2;
        # listen             [::]:443 ssl http2;

        server_name  sub.domain.com;
        root         /var/www/domain/public;

        index   index.php;

        # Try file or rewrite
        try_files $uri $uri/ @notfile;
        location @notfile {
            rewrite ^(.*) /index.php last;
        }

        # Set expires max on static file types
        location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|eot|mp4|ogg|ogv|webm)$ {
            # expires max;
            expires 500;
            root   /var/www/domain/public;
            access_log off;
        }

        # Opt-in to the future
        add_header "X-UA-Compatible" "IE=Edge,chrome=1";

        # PHP handler
        location ~ \.php {
            try_files $uri =404;
            proxy_max_temp_file_size 32M;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;

            # Use if php-fpm is using a network socket
            # fastcgi_pass 127.0.0.1:9000;

            # Use if php-fpm is using file based socket
            fastcgi_pass unix:/run/php/domain-fpm.sock;

            fastcgi_read_timeout 120s;
            fastcgi_index index.php;
            include fastcgi.conf;
        }

client_max_body_size    100m;

        # Fallback
        location ~ /\. {
            log_not_found off;
            deny all;
        }
}