When executing “./20.04/nginx_add_site.sh” based on laravel-ubuntu-init, fill in the project name and report the error “Item name contains illegal characters” error
1. When executing “./20.04/nginx_add_site.sh”, fill in the project name and report the error “Item name contains illegal characters” error. as shown in Figure 1
root@iZ2ze4fjghbbj74d4kfnf0Z:~/laravel-ubuntu-init# ./20.04/nginx_add_site.sh
请输入项目名:lashop
项目名包含非法字符
2. Edit ./20.04/nginx_add_site.sh, and comment out the code that prompts the error. as shown in Figure 2
#[[ $project =~ ^[a-zA-Z\0-9_\-\.]+$ ]] || {
# ansi -n --bold --bg-red "项目名包含非法字符"
# exit 1
#}
3. The execution will be executed again ./20.04/nginx_add_site.sh, no more errors will be reported. as shown in Figure 3
root@iZ2ze4fjghbbj74d4kfnf0Z:~/laravel-ubuntu-init# ./20.04/nginx_add_site.sh
请输入项目名:laravel-shop
请输入站点域名(多个域名用空格隔开):-
域名列表:-
项目名:laravel-shop
项目目录:/var/www/laravel-shop
是否确认? [y/N] y
配置文件创建成功
Nginx 重启成功


