examples/apache.conf

1
# Apache example for hgweb-static: route only Mercurial wire-protocol
2
# requests (?cmd=...) to hgweb; everything else is served as static files.
3
#
4
# Requires: a2enmod rewrite proxy proxy_http
5
#
6
# On Sympl, drop these directives into
7
#   /srv/code.example.org/config/apache.d/hgweb.conf
8
# (included in the domain's vhost; test with `apache2ctl -t` before
9
# reloading) and point hgstatic's --out at
10
#   /srv/code.example.org/public/htdocs
11
#
12
# On plain Apache, put them inside your <VirtualHost> instead, with
13
# DocumentRoot set to the hgstatic output directory.
14
 
15
RewriteEngine On
16
# Real hg clients are the only thing that sends ?cmd=.
17
RewriteCond %{QUERY_STRING} (^|&)cmd=
18
RewriteRule ^ http://127.0.0.1:8420%{REQUEST_URI} [P,L]
19
ProxyPreserveHost On
20
 
21
# Bind gunicorn to match: --bind 127.0.0.1:8420