forked from skx/tunneller
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide a complete Apache configuration.
- Loading branch information
Showing
2 changed files
with
82 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Apache2 Setup | ||
|
||
The following is a complete configuration file for Apache2, as used in | ||
production: | ||
|
||
# | ||
# This is the bare-tunnel domain. | ||
# | ||
# Accesses to this will be websockets, so we need to handle | ||
# that by using `ws:/` | ||
# | ||
<VirtualHost 176.9.183.100:80> | ||
ServerName tunneller.steve.fi | ||
|
||
RewriteEngine On | ||
RewriteCond %{HTTP:Upgrade} =websocket [NC] | ||
RewriteRule /(.*) ws://localhost:8080/$1 [P,L] | ||
RewriteCond %{HTTP:Upgrade} !=websocket [NC] | ||
RewriteRule /(.*) http://localhost:8080/$1 [P,L] | ||
|
||
<Proxy *> | ||
Order allow,deny | ||
Allow from all | ||
</Proxy> | ||
|
||
ProxyPass / http://localhost:8080/ Keepalive=On | ||
ProxyPassReverse / http://localhost:8080/ Keepalive=On | ||
|
||
<Location /> | ||
Order allow,deny | ||
Allow from all | ||
</Location> | ||
|
||
ProxyPreserveHost on | ||
ProxyBadHeader ignore | ||
</VirtualHost> | ||
|
||
|
||
# | ||
# This is the wildcard virtual-host, which will be accessed by | ||
# the internet and proxied. | ||
# | ||
# We don't need to care about websockets here. | ||
# | ||
<VirtualHost 176.9.183.100:80> | ||
ServerName a.tunneller.steve.fi | ||
ServerAlias *.tunneller.steve.fi | ||
|
||
<Proxy *> | ||
Order allow,deny | ||
Allow from all | ||
</Proxy> | ||
|
||
ProxyPass / http://localhost:8080/ Keepalive=On | ||
ProxyPassReverse / http://localhost:8080/ Keepalive=On | ||
|
||
<Location /> | ||
Order allow,deny | ||
Allow from all | ||
</Location> | ||
|
||
ProxyPreserveHost on | ||
ProxyBadHeader ignore | ||
</VirtualHost> | ||
|
||
|
||
## Modules | ||
|
||
Note if you're not using the proxy-modules already you'll need: | ||
|
||
a2enmod proxy | ||
a2enmod proxy_http | ||
a2enmod proxy_wstunnel |