Changeset - cec677a84142
[Not reviewed]
default
0 1 0
Drew Perttula - 9 years ago 2016-06-01 10:55:15
drewp@bigasterisk.com
homepage serve show root() dir
Ignore-this: e48e8b8e7889fd8c63d18cf70c29c260
1 file changed with 19 insertions and 7 deletions:
0 comments (0 inline, 0 general)
bin/homepageConfig
Show inline comments
 
@@ -14,13 +14,7 @@ graph = showconfig.getGraph()
 
netHome = graph.value(showconfig.showUri(), L9['networking'])
 
print "listen %s;" % splitport(urlparse(graph.value(netHome, L9['webServer'])).netloc)[1]
 

	
 
for role, server in sorted(graph.predicate_objects(netHome)):
 
    if not server.startswith('http') or role == L9['webServer']:
 
        continue
 
    path = graph.value(role, L9['urlPath'])
 
    if not path:
 
        continue
 
    server = server.rstrip('/')
 
def location(path, server):
 
    print """
 
    location /%(path)s {
 

	
 
@@ -33,3 +27,21 @@ for role, server in sorted(graph.predica
 
      proxy_pass %(server)s;
 
      rewrite /[^/]+/(.*) /$1 break;
 
    }""" % vars()
 

	
 
for role, server in sorted(graph.predicate_objects(netHome)):
 
    if not server.startswith('http') or role == L9['webServer']:
 
        continue
 
    path = graph.value(role, L9['urlPath'])
 
    if not path:
 
        continue
 
    server = server.rstrip('/')
 
    location(path, server)
 

	
 

	
 

	
 
showPath = showconfig.showUri().split('/', 3)[-1]
 
print """
 
    location /%(path)s {
 
      root %(root)s;
 
    }""" % {'path': showPath,
 
            'root': showconfig.root()[:-len(showPath)]}
0 comments (0 inline, 0 general)