Files
@ b400924f83e7
Branch filter:
Location: light9/bin/homepageConfig - annotation
b400924f83e7
1.0 KiB
text/plain
2015 stage layout
Ignore-this: a178a29e8b4ec76a07a033a1814e37a1
Ignore-this: a178a29e8b4ec76a07a033a1814e37a1
0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 70f42f9d6e04 70f42f9d6e04 0d295af23c4b 0d295af23c4b 0d295af23c4b 0d295af23c4b 70f42f9d6e04 0d295af23c4b 70f42f9d6e04 70f42f9d6e04 e703b3434dbd 70f42f9d6e04 70f42f9d6e04 70f42f9d6e04 70f42f9d6e04 70f42f9d6e04 70f42f9d6e04 70f42f9d6e04 70f42f9d6e04 70f42f9d6e04 e703b3434dbd 70f42f9d6e04 70f42f9d6e04 70f42f9d6e04 70f42f9d6e04 70f42f9d6e04 0d295af23c4b 70f42f9d6e04 70f42f9d6e04 70f42f9d6e04 | #!bin/python
from run_local import log
from rdflib import RDF, URIRef
from light9 import networking, showconfig
from light9.namespaces import L9
from urlparse import urlparse
from urllib import splitport
from light9.rdfdb.syncedgraph import SyncedGraph
from twisted.internet import reactor
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 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('/')
print """
location /%(path)s {
# for websocket
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_pass %(server)s;
rewrite /[^/]+/(.*) /$1 break;
}""" % vars()
|