HEX
Server: nginx/1.29.3
System: Linux 11979.bigscoots-wpo.com 6.8.0-88-generic #89-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 01:02:46 UTC 2025 x86_64
User: nginx (1068)
PHP: 7.4.33
Disabled: exec,system,passthru,shell_exec,proc_open,proc_close,popen,show_source,cmd# Do not modify this line # 1684243876
Upload Files
File: //bigscoots/wpo_forcehttps.sh
#!/bin/bash

if [ -z "$1" ]

then

for i in $(find /usr/local/nginx/conf/conf.d/ -type f -printf "%f\n" |grep -v 'phpmyadmin_ssl.conf\|virtual.conf\|.ssl.conf\|.bak') ; do

domain="${i//.conf/}"

cp /usr/local/nginx/conf/conf.d/"$domain".conf{,.bak}

{
echo "# BigScoots Force HTTPS"
echo "  server {"
echo "            listen   80;"
echo "            server_name $domain www.$domain;"
echo ""
echo "    location /.well-known/acme-challenge/ {"
echo "        allow all;"
echo "        default_type \"text/plain\";"
echo "        root /home/nginx/domains/$domain/public;"
echo "        try_files \$uri =404;"
echo "        break;"
echo "    }"
echo "       location / {"
echo "            include /usr/local/nginx/conf/wpincludes/"$domain"/redirects.conf;"
echo "            return 301 https://$domain\$request_uri;"
echo "       }"
echo "}"


} > /usr/local/nginx/conf/conf.d/"$domain.conf"

done

else

domain="$1"

cp /usr/local/nginx/conf/conf.d/"$domain".conf{,.bak}

{
echo "# BigScoots Force HTTPS"
echo "  server {"
echo "            listen   80;"
echo "            server_name $domain www.$domain;"
echo ""
echo "    location /.well-known/acme-challenge/ {"
echo "        allow all;"
echo "        default_type \"text/plain\";"
echo "        root /home/nginx/domains/$domain/public;"
echo "        try_files \$uri =404;"
echo "        break;"
echo "    }"
echo "       location / {"
echo "            include /usr/local/nginx/conf/wpincludes/"$domain"/redirects.conf;"
echo "            return 301 https://$domain\$request_uri;"
echo "       }"
echo "}"

} > /usr/local/nginx/conf/conf.d/"$domain.conf"

fi