diff --git a/tests/test_nginx_vhosts.py b/tests/test_nginx_vhosts.py
index 69be6eb4d3547acf5bd97d493ed3a5006849f823..cff58d5c15f49a099ca702f61ea5b75ed0780764 100755
--- a/tests/test_nginx_vhosts.py
+++ b/tests/test_nginx_vhosts.py
@@ -55,7 +55,9 @@ resolution_ignored = conf.get('TESTER_VHOST_RESOLUTION_IGNORED', '').split(',')
 found = False
 errors = 0
 warnings = 0
-for name in os.listdir(nginx_dir):
+names = os.listdir(nginx_dir)
+names.sort()
+for name in names:
     path = os.path.join(nginx_dir, name)
     with open(path, 'r') as fo:
         vhost = fo.read()