diff --git a/pyhaproxy/render.py b/pyhaproxy/render.py
index <HASH>..<HASH> 100644
--- a/pyhaproxy/render.py
+++ b/pyhaproxy/render.py
@@ -165,8 +165,14 @@ backend %s
 
     def __render_server(self, server):
         server_line = '    server %s %s:%s %s\n'
+        attributes = []
+
+        #Strip out heading/trailing whitespace
+        for a in server.attributes:
+            attributes.append(a.strip())
+
         return server_line % (
-            server.name, server.host, server.port, ' '.join(server.attributes))
+            server.name, server.host, server.port, ' '.join(attributes))
 
     def __render_acl(self, acl):
         acl_line = '    acl %s %s\n'
Fix bug that would introduce whitespace to attributes with each new
render