Well... it doesn't. But by default it doesn't follow redirects, so it SEEMS like curl doesn't work with most websites over https. You can tell CURL to follow redirects by using the -L flag, but remembering that is something I almost never do. Plus, tons of other sites work with CURL, how do they do it?
Today, I found out.
The video from @DigitalMetal that started this rabbit hole is right here:
• Get Your IP Address in...
The simple PHP code I use to return the IP address is here (remember to use the PHP tags, KZitem doesn't allow tags in the video description):
if ($_SERVER["HTTP_X_FORWARDED_FOR"] != "")
echo $_SERVER["HTTP_X_FORWARDED_FOR"];
else
echo $_SERVER["REMOTE_ADDR"];
The complicated configuration logic for my Caddy server is here:
ip.snar.co, ip.snar.co {
@notcurl {
not {
header User-Agent curl
path /
}
protocol http
}
redir @notcurl {host}{uri}
root * /var/www/ip
file_server
encode gzip
php_fastcgi unix//run/php/php7.2-fpm.sock
}
And of course, if you'd like to learn more about Caddy and how it works, let me know. I'd be more than happy to talk more about how great it is!
#Linux #Caddy #SSL
Find me online:
/ shawnp0wers
brainofshawn.com
Check out my comic!
/ mybigroundworld
Негізгі бет Why Does CURL Hate SSL?!?
Пікірлер: 7