Closed TheBestPessimist closed 2 years ago
Hey there!
Yes -- I'm using nginx and detecting the user agent that's initiating the request. Here is the complete config, nothing fancy:
server {
listen 80;
server_name yabs.sh;
if ( $http_user_agent ~ 'curl' ) {
return 301 https://raw.githubusercontent.com/masonr/yet-another-bench-script/master/yabs.sh;
}
if ( $http_user_agent ~ 'Wget' ) {
return 301 https://raw.githubusercontent.com/masonr/yet-another-bench-script/master/yabs.sh;
}
return 301 https://github.com/masonr/yet-another-bench-script;
}
Let me know if you have any other questions.
Cheers, -Mason
Hey, I see that running
wget -vO- yabs.sh
does a redirect to the raw github link, however opening yabs.sh directly in the browser does a redirect to the repo. Running in powershell on windows also redirects to normal github repo, not the raw page.Do you use wget's user agent as discriminator or what else? Is there a repo showing this setup?
Thanks