13 lines
656 B
Bash
13 lines
656 B
Bash
#!/bin/bash
|
|
sed -i 's|proxy_pass http://10.0.4.1:3000;|proxy_pass http://127.0.0.1:3000;|' /etc/nginx/sites-enabled/yuyueguahao
|
|
echo "--- Updated config ---"
|
|
grep -B1 -A3 uploads /etc/nginx/sites-enabled/yuyueguahao
|
|
NGINX_MASTER=$(ps -efL | grep "nginx: master" | grep -v grep | awk '{print $2}' | head -1)
|
|
echo "Reload master PID: $NGINX_MASTER"
|
|
kill -HUP "$NGINX_MASTER"
|
|
sleep 2
|
|
echo "--- TEST 80 ---"
|
|
curl -o /dev/null -s -w "HTTP %{http_code} size=%{size_download} type=%{content_type}\n" http://localhost/uploads/1781403331659-1cac3cac.png
|
|
echo "--- TEST API (sanity) ---"
|
|
curl -o /dev/null -s -w "HTTP %{http_code}\n" http://localhost/api/v1/banners
|