title: nginx loadbalancer conf file parse python
body: <p>I have a nginx conf file like this:</p>
  
  <pre><code>upstream server1.stack.com {
     zone server1.stack.com 2048k;
     #least_time header;
     least_conn;
     keepalive 256;
     server 10.10.12.141:3311 max_fails=0 slow_start=10s;
     server 10.10.12.141:33311 max_fails=0 slow_start=10s;
  }
  server {
     listen 10.11.128.194:80 backlog=102400 reuseport;
     server_name server1.stack.com;
     status_zone server1.stack.com;
     location / {
         proxy_pass http://server1.stack.com;
         proxy_set_header Host $http_host;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_http_version 1.1;
         proxy_set_header Connection "";
         #health_check;
     }
     location @hc {
         proxy_pass http://server1.stack.com;
         proxy_set_header Host server1.stack.com;
         proxy_http_version 1.1;
         proxy_set_header Connection "";
         health_check uri=/status interval=3 fails=2 passes=2;
         error_log /var/log/nginx/error_hc.log info;
     }
  }
  </code></pre>
  
  <p>And I want to parse this file like this:</p>
  
  <pre><code>server1.stack.com = {'zone':['server1.stack.com','2048k',';'],'#least_time':['header',';'],'least_conn':[';']'live':['256',';'],'server':['10.10.12.141:3311','max_fails=0','slow_start=10s',';']}...
  </code></pre>
  
  <p>Key: zone
  Value: server1.stack.com, 2048, ;</p>
  
  <p>or if you have a different suggestion I will gladly listen.</p>
  
  <p>I want to send all config to web page form inputs But I did not split the config.</p>