Skip to content

Commit

Permalink
Separate vhosts for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
florensie committed Jul 24, 2022
1 parent efb7ca1 commit 61ef239
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 21 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:

proxy:
build:
context: tools/apache-hosts
context: tools/docker/apache-hosts
# environment:
# - HOST=example.com
# - DWC_HOST=example.com
network_mode: "host"
6 changes: 3 additions & 3 deletions tools/apache-hosts/dls1.nintendowifi.net.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName dls1.${HOST}
ServerAlias "dls1.${HOST}"
ServerAlias "dls1.${HOST}, dls1.${HOST}"
ServerName dls1.nintendowifi.net
ServerAlias "dls1.nintendowifi.net"
ServerAlias "dls1.nintendowifi.net, dls1.nintendowifi.net"
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:9003/
ProxyPassReverse / http://127.0.0.1:9003/
Expand Down
4 changes: 2 additions & 2 deletions tools/apache-hosts/gamestats.gs.nintendowifi.net.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName gamestats.gs.${HOST}
ServerAlias "gamestats.gs.${HOST}, gamestats.gs.${HOST}"
ServerName gamestats.gs.nintendowifi.net
ServerAlias "gamestats.gs.nintendowifi.net, gamestats.gs.nintendowifi.net"
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:9002/
ProxyPassReverse / http://127.0.0.1:9002/
Expand Down
4 changes: 2 additions & 2 deletions tools/apache-hosts/gamestats2.gs.nintendowifi.net.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName gamestats2.gs.${HOST}
ServerAlias "gamestats2.gs.${HOST}, gamestats2.gs.${HOST}"
ServerName gamestats2.gs.nintendowifi.net
ServerAlias "gamestats2.gs.nintendowifi.net, gamestats2.gs.nintendowifi.net"

ProxyPreserveHost On

Expand Down
12 changes: 6 additions & 6 deletions tools/apache-hosts/nas-naswii-conntest.nintendowifi.net.conf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName naswii.${HOST}
ServerAlias "naswii.${HOST}, naswii.${HOST}"
ServerAlias "nas.${HOST}"
ServerAlias "nas.${HOST}, nas.${HOST}"
ServerAlias "conntest.${HOST}"
ServerAlias "conntest.${HOST}, conntest.${HOST}"
ServerName naswii.nintendowifi.net
ServerAlias "naswii.nintendowifi.net, naswii.nintendowifi.net"
ServerAlias "nas.nintendowifi.net"
ServerAlias "nas.nintendowifi.net, nas.nintendowifi.net"
ServerAlias "conntest.nintendowifi.net"
ServerAlias "conntest.nintendowifi.net, conntest.nintendowifi.net"
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:9000/
ProxyPassReverse / http://127.0.0.1:9000/
Expand Down
8 changes: 4 additions & 4 deletions tools/apache-hosts/sake.gs.nintendowifi.net.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName sake.gs.${HOST}
ServerAlias sake.gs.${HOST} *.sake.gs.${HOST}
ServerAlias secure.sake.gs.${HOST}
ServerAlias secure.sake.gs.${HOST} *.secure.sake.gs.${HOST}
ServerName sake.gs.nintendowifi.net
ServerAlias sake.gs.nintendowifi.net *.sake.gs.nintendowifi.net
ServerAlias secure.sake.gs.nintendowifi.net
ServerAlias secure.sake.gs.nintendowifi.net *.secure.sake.gs.nintendowifi.net

ProxyPass / http://127.0.0.1:8000/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ ENV APACHE_LOG_DIR=/usr/local/apache2/logs

# Change this if you have your own domain name set up
# Otherwise, you will need to set up a DNS server to point nintendowifi.net to your IP address
ENV HOST=nintendowifi.net
ENV DWC_HOST=nintendowifi.net

# TODO: do in one line
# vhost config
RUN echo $'IncludeOptional /usr/local/apache2/vhost.d/*.conf\n\
ServerName localhost\n\
HttpProtocolOptions Unsafe' >> conf/httpd.conf

# Enable proxy module
RUN sed -i 's/^#LoadModule proxy_module/LoadModule proxy_module/' conf/httpd.conf
RUN sed -i 's/^#LoadModule proxy_http_module/LoadModule proxy_http_module/' conf/httpd.conf

# Copy vhosts
COPY *.conf vhost.d/
9 changes: 9 additions & 0 deletions tools/docker/apache-hosts/dls1.nintendowifi.net.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName dls1.${DWC_HOST}
ServerAlias "dls1.${DWC_HOST}"
ServerAlias "dls1.${DWC_HOST}, dls1.${DWC_HOST}"
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:9003/
ProxyPassReverse / http://127.0.0.1:9003/
</VirtualHost>
8 changes: 8 additions & 0 deletions tools/docker/apache-hosts/gamestats.gs.nintendowifi.net.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName gamestats.gs.${DWC_HOST}
ServerAlias "gamestats.gs.${DWC_HOST}, gamestats.gs.${DWC_HOST}"
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:9002/
ProxyPassReverse / http://127.0.0.1:9002/
</VirtualHost>
10 changes: 10 additions & 0 deletions tools/docker/apache-hosts/gamestats2.gs.nintendowifi.net.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName gamestats2.gs.${DWC_HOST}
ServerAlias "gamestats2.gs.${DWC_HOST}, gamestats2.gs.${DWC_HOST}"

ProxyPreserveHost On

ProxyPass / http://127.0.0.1:9002/
ProxyPassReverse / http://127.0.0.1:9002/
</VirtualHost>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName naswii.${DWC_HOST}
ServerAlias "naswii.${DWC_HOST}, naswii.${DWC_HOST}"
ServerAlias "nas.${DWC_HOST}"
ServerAlias "nas.${DWC_HOST}, nas.${DWC_HOST}"
ServerAlias "conntest.${DWC_HOST}"
ServerAlias "conntest.${DWC_HOST}, conntest.${DWC_HOST}"
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:9000/
ProxyPassReverse / http://127.0.0.1:9000/
</VirtualHost>
11 changes: 11 additions & 0 deletions tools/docker/apache-hosts/sake.gs.nintendowifi.net.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName sake.gs.${DWC_HOST}
ServerAlias sake.gs.${DWC_HOST} *.sake.gs.${DWC_HOST}
ServerAlias secure.sake.gs.${DWC_HOST}
ServerAlias secure.sake.gs.${DWC_HOST} *.secure.sake.gs.${DWC_HOST}

ProxyPass / http://127.0.0.1:8000/

CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

0 comments on commit 61ef239

Please sign in to comment.