I want to proxy one URI of my domain to a specific backend server.
I have a public domain name external.lan
and a private one lets say internal.lan
.
I want http://external.lan/gogs
be served by internal
server.
Here is my apache configuration block:
ProxyPass "/gogs" "http://internal.lan/gogs"
ProxyPassReverse "/gogs" "http://internal.lan/gogs"
This returns in logs:
[proxy:debug] [pid 4025] proxy_util.c(2118): AH00924: worker http://backup.localnet.lan shared already initialized
I have also tried:
ProxyPass "/gogs/(.*)$" "http://internal.lan/$1"
ProxyPassReverse "/gogs" "http://internal.lan/gogs"
This returns 404 error in external server logs.
I have also tried with mod_rewrite:
RewriteEngine On
RewriteRule "^/gogs/(.*)$" "http://internal.lan/$1 [P]
RewriteRule "/gogs/" "http://internal.lan/ [P,L]
With no luck.
How it is possible with only one domain name to proxy some URIs to backend server?
EDIT: here is my configuration file:
ServerSignature Off
Alias /glpi/ /var/www/glpi/
#ProxyPass "/gogs/(.*)$" "http://backup.localnet.lan:6000/$1"
#ProxyPass "/gogs/" "http://backup.localnet.lan:6000/"
#ProxyPassReverse "/gogs" "http://backup.localnet.lan:6000/gogs"
ProxyPass "/gogs/" "http://backup.localnet.lan/"
#ProxyPassReverse /gogs/ http://backup.localnet.lan:6000
<VirtualHost web.localnet.lan:80>
ServerAdmin [email protected]
ServerName web.localnet.lan
ServerAlias web
DocumentRoot /var/www/glpi
<Directory />
Options None
AllowOverride None
</Directory>
<Directory /var/www/glpi>
Options None
AllowOverride None
</Directory>
<Directory /var/www/glpi/files>
Options None
AllowOverride None
Order allow,deny
deny from all
</Directory>
# RewriteEngine On
# RewriteRule /gogs/(.*) http://backup.localnet.lan/$1 [P,L]
# RewriteRule /gogs/ http://backup.localnet.lan/ [P,L]
# RewriteRule "/gogs/" "http://backup.localnet.lan/ [P,L]
# ProxyPassReverse "/gogs/" "http://backup.localnet.lan/"
# #RewriteRule "^/gogs/(.+)" "http://backup.localnet.lan/" [R,L]
LogLevel debug rewrite:trace6
CustomLog ${APACHE_LOG_DIR}/glpi-access.log combined
ErrorLog ${APACHE_LOG_DIR}/glpi-error.log
</VirtualHost>