centos-nginx 571 B

1234567891011121314151617181920
  1. #!/usr/bin/env bash
  2. [[ $fpm_listen =~ (.*):([[:digit:]]+) ]] && \
  3. { ip=${BASH_REMATCH[1]}; port=${BASH_REMATCH[2]}; } || \
  4. { ip=127.0.0.1; port=$fpm_listen; }
  5. $userdo bash -c "cat <<- CONF > /etc/nginx/default.d/info.conf
  6. location = /info.php {
  7. root /var/www;
  8. fastcgi_split_path_info ^(.+.php)(/.+)$;
  9. fastcgi_pass $ip:$port;
  10. #fastcgi_index info.php;
  11. include fastcgi.conf;
  12. }
  13. CONF"
  14. $user_do bash -c 'echo "<?php phpinfo();" > /var/www/info.php'
  15. $user_do systemctl enable nginx
  16. $user_do systemctl start nginx
  17. $user_do systemctl status nginx