Created
April 10, 2020 12:48
-
-
Save bng44270/98b36265b7fa143565ae2fe8a61e58c3 to your computer and use it in GitHub Desktop.
Reverse Proxy DD-WRT through Apache
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
################################## | |
# ddwrt.conf | |
# | |
# Reverse Proxy DD-wrt through Apache | |
# | |
# Usage: | |
# | |
# Use DDwrtProxyHTTP /ddwrt 192.168.1.1 www.andydoestech.com | |
# | |
# ^---Makes dd-wrt accessble via http://www.andydoestech.com/ddwrt/ | |
# | |
# Use DDwrtProxyHTTPS /ddwrt 192.168.1.1 www.andydoestech.com | |
# | |
# ^---Same as previous, except makes it accessible via https://www.andydoestech.com/ddwrt/ | |
# | |
################################## | |
<Macro DDwrtProxyHTTP $proxypath $ddwrtip $domain> | |
<Location $proxypath> | |
ProxyPass http://$ddwrtip | |
ProxyPassReverse http://$ddwrtip | |
RequestHeader unset referer | |
SetOutputFilter INFLATE;SUBSTITUTE;DEFLATE | |
Substitute "s|return \"/ttgraph.cgi|return \"/local/gw/ttgraph.cgi|in" | |
Substitute "s|src=\"/graph_if.svg|src=\"/local/gw/graph_if.svg|in" | |
</Location> | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} $proxypath$ | |
RewriteRule ^(.*)$ http://$domain$proxypath/ [R,L] | |
</Macro> | |
<Macro DDwrtProxyHTTPS $proxypath $ddwrtip $domain> | |
<Location $proxypath> | |
ProxyPass http://$ddwrtip | |
ProxyPassReverse http://$ddwrtip | |
RequestHeader unset referer | |
SetOutputFilter INFLATE;SUBSTITUTE;DEFLATE | |
Substitute "s|return \"/ttgraph.cgi|return \"/local/gw/ttgraph.cgi|in" | |
Substitute "s|src=\"/graph_if.svg|src=\"/local/gw/graph_if.svg|in" | |
</Location> | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} $proxypath$ | |
RewriteRule ^(.*)$ https://$domain$proxypath/ [R,L] | |
</Macro> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment