如何使用通配符使用nginx部署laravel

I want to deploy my laravel application with nginx using wildcard domain. But that not work correctly. I have this error:

Corrupted Content Error

The site at http://www.exemple.com/ has experienced a network protocol violation that cannot be repaired. The page you are trying to view cannot be shown because an error in the data transmission was detected. Please contact the website owners to inform them of this problem.

An example for my laravel routing

<?php

 Route::group(['domain' => "{sub}.exemple.com"], function() {
     // load site content
 });

This is my nginx configuration:

server {
    # Update max body size
    client_max_body_size 20M;

    # SSL configuration
    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server ipv6only=on;

    ssl on;
    include /etc/nginx/snippets/self-signed.conf;
    include /etc/nginx/snippets/ssl-params.conf;

    # Route and app index
    root /var/www/site/public;
    index index.php index.html;

    # Make site accessible from https://www.exemple.com
    server_name ~^([a-z]+)\.exemple\.com$;

    location / {
       if ($http_x_forwarded_proto != "https") {
            return 301 https://$1.exemple.com$request_uri;
       }

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

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SERVER_NAME $host;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }

    location ~* \.(?:ico|gif|jpe?g|png)$ {
        expires 7d;
        add_header Pragma public;
        add_header Cache-Control "public";
        access_log off;
    }

    location ~* \.(css|js|ttf)$ {
        expires 1d;
        access_log off;
        add_header Cache-Control "public";
    }
}