location / {
    if (!-e $request_filename) {
        rewrite ^/(.*)$ /index.php/$1 last;
        break;
    }

    if ($request_uri = "/") {
        return 301 $scheme://$http_host/dist/;
    }

    location /console/ {
        if ($host ~* "yyangpt") {
            rewrite ^/console/(.*)$ /Console/$1 permanent;
        }
    }

    proxy_cookie_flags ~ secure;
    proxy_cookie_flags ~ httponly;
}
