-
Notifications
You must be signed in to change notification settings - Fork 0
/
new-site.sh.example
executable file
·49 lines (34 loc) · 1.18 KB
/
new-site.sh.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash -e
read -p "Domain:" sitedomain
read -p "Public path:" sitepath
echo $sitedomain
echo $sitepath
if [ ! -f '/home/USER_NAME/ship/nginx/vhosts/$sitedomain.conf' ]; then
touch /home/USER_NAME/ship/nginx/vhosts/$sitedomain.conf
echo "
server {
listen 0.0.0.0:80;
listen [::]:80;
root /var/www/html/$sitepath/;
index index.php index.html index.htm;
server_name $sitedomain;
client_max_body_size 128m;
location / {
try_files \$uri \$uri/ /index.php?\$args;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f \$document_root\$fastcgi_script_name) {
return 404;
}
include fastcgi_params;
fastcgi_pass php8.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME \$document_root/\$fastcgi_script_name;
}
}
" >> /home/USER_NAME/ship/nginx/vhosts/$sitedomain.conf
fi
docker-compose down
docker-compose up -d
"/mnt/c/Program Files/gsudo/Current/gsudo.exe" "echo 127.0.0.1 $sitedomain >> C:/Windows/System32/drivers/etc/hosts.ics"