Probably shouldn't be "hard" coding the scheme (http). Check $_SERVER['https']. You can make sure this fastcgi param exists with a simple directive in nginx (fastcgi_params):
fastcgi_param HTTPS $https if_not_empty;
Also, the 404 route, should be able to be defined as a custom function: Macaw::fourofour(function() {
header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");
header("Status: 404 Not Found");
});