Difference between revisions of "Apache2"
From DarkWiki
(→Simple proxy) |
(→Simple proxy) |
||
| Line 2: | Line 2: | ||
===Simple proxy=== | ===Simple proxy=== | ||
| + | |||
| + | This example will receive HTTP requests headed towards HOSTNAME.darkmine.org, and will proxy them to the web server residing on 10.1.1.96 (port 3000). If URLs in the response have that internal IP (10.1.1.96:3000), they will be transformed to the "hostname.darkmine.org" version. | ||
<pre> | <pre> | ||
| + | <VirtualHost *:80> | ||
| + | ServerName HOSTNAME.darkmine.org | ||
| + | ServerAdmin webmaster@localhost | ||
| + | ErrorLog ${APACHE_LOG_DIR}/error.log | ||
| + | CustomLog ${APACHE_LOG_DIR}/access.log combined | ||
| + | |||
| + | ProxyPass "/" "http://10.1.1.96:3000/" | ||
| + | ProxyPassReverse "/" "http://10.1.1.96:3000/" | ||
| + | </VirtualHost> | ||
</pre> | </pre> | ||
Revision as of 08:45, 3 June 2017
Example configuration
Simple proxy
This example will receive HTTP requests headed towards HOSTNAME.darkmine.org, and will proxy them to the web server residing on 10.1.1.96 (port 3000). If URLs in the response have that internal IP (10.1.1.96:3000), they will be transformed to the "hostname.darkmine.org" version.
<VirtualHost *:80>
ServerName HOSTNAME.darkmine.org
ServerAdmin webmaster@localhost
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPass "/" "http://10.1.1.96:3000/"
ProxyPassReverse "/" "http://10.1.1.96:3000/"
</VirtualHost>