def served_by_nginx(url):
 r = requests.get(url, allow_redirects=False)
 status = (r.status_code == 200)
 nginx = (('x-served' in r.headers) and (r.headers['x-served'] == 'Nginx'))
 return all([status, nginx])

def served_by_nginx ( url ) : r = requests . get ( url , allow_redirects = False ) status = ( r . status_code == 200 ) nginx = ( ( 'x-served' in r . headers ) and ( r . headers [ 'x-served' ] == 'Nginx' ) ) return all ( [ status , nginx ] )
return true if url returns 200 and is served by nginx .