403Webshell
Server IP : 119.195.102.159  /  Your IP : 216.73.217.134
Web Server : nginx/1.18.0
System : Linux picell 5.15.0-181-generic #191-Ubuntu SMP Fri May 22 19:09:02 UTC 2026 x86_64
User : altablue ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/altablue/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/altablue/install-ssl.sh.save
for f in /etc/nginx/sites-available/*.conf; do
  # 1) server_name에서 첫 번째 도메인 추출
  domain=$(grep -m1 -E '^\s*server_name' "$f" | awk '{print $2}')
  if [ -z "$domain" ]; then
    echo "[SKIP] server_name 없음: $f"
    continue
  fi

  echo "[PATCH] $f → SSL block for $domain"

  # 2) listen 443 ssl http2; 아래에 SSL 설정 삽입
  sudo sed -i -E "/listen\s+443\s+ssl\s+http2;/a \\
    ssl_certificate     /etc/letsencrypt/live/$domain/fullchain.pem;\\
    ssl_certificate_key /etc/letsencrypt/live/$domain/privkey.pem;\\
    include             /etc/letsencrypt/options-ssl-nginx.conf;\\
    ssl_dhparam         /etc/letsencrypt/ssl-dhparams.pem;" "$f"
done

# 3) 설정 검사 및 재시작
sudo nginx -t && sudo systemctl reload nginx



Youez - 2016 - github.com/yon3zu
LinuXploit