Score:0

apache proxy an URI to a backend server

im flag

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>
pt flag
Can you share a complete configuration the reproduces the problem? If e.g. I grab the official httpd Docker image and deploy it with the stock configuration modified by your ProxyPass directives, it seems to work just fine (see [here](https://gist.github.com/larsks/b7ad7c96d895a9718f82152f189ee310) for my reproducer).
im flag
Thanks for your comment and your help with this investigation. I have just edited my question to provide my config file.
im flag
OK, nevermind. I got from your comment that issue i was having was not related to apache configuration. These servers were running into VMs, and i have bridge issues on the admin network.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.