Score:0

apache2 reverse proxy, how to serve multiple domains with backend recognizing only 1 valid uri

fr flag

I have an Apache reverse proxy set up and my backend service is configured on a specific static ServiceUri="site.com". I would like requests coming for multiple domains a.site.com/data, b.site.com/data etc. to be forwarded to my backend service. The problem is that my service does not recognize a.site.com/data as valid. Only site.com/data is served. I cannot change the backend to be flexible enough to accept $random$.site.com URIs. Is there a way for me to manipulate the request header within the VirtualHost so that my backend only sees a request of site.com/data but the reply to the queried clients still respects the original header? My VH looks like this:

<IfModule mod_ssl.c>
        Listen 3000
        <VirtualHost _default_:3000>

                DocumentRoot /var/www/html

                SSLEngine on

                SSLCertificateFile      /etc/apache2/ssl/dom.pem
                SSLCertificateKeyFile /etc/apache2/ssl/dom.key

               <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>

                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>


               SSLProxyEngine on
               SSLProxyVerify none
               SSLProxyCheckPeerCN off
               ProxyPass / https://127.0.0.1:9000/
               ProxyPassReverse / https://127.0.0.1:9000/

        </VirtualHost>
</IfModule>
Steffen Ullrich avatar
se flag
Does this answer your question? [Apache proxy\_http redirect to ip and set hostname](https://serverfault.com/questions/557233/apache-proxy-http-redirect-to-ip-and-set-hostname)
Mnemosyne avatar
fr flag
yes, it did! thank you
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.