Q
Q
Quqas2021-02-08 22:59:15
Apache HTTP Server
Quqas, 2021-02-08 22:59:15

Ubuntu + apache how to correctly wrap PART of http traffic to a completely different server using proxypass?

read this 2 servers on port 80 - how to implement?

in principle, I need the same thing, but as always, nuances, nuances
, firstly, I have ubuntu and not debian, and I'm in linux at the copy-paste level.
secondly, I want to do this in one config;
thirdly, about transferring the port of the current local site, the need is not completely clear,
and fourthly, the syntax itself is still not entirely clear.

Situation:
we have 2 physically different servers and 1 white ip
on "our" dns cld.site.in and rds.site.in are correctly registered
on the "external" dns, both records on 1 ip indicate
on the router 80 "from the outside" forwarded to cld. site.in
and for https, each has its own port and its own forwarding.

cld.site.in is ubuntu + apache
only 1 site and spinning is
registered in
/etc/apache2/sites-available/000-default.conf

of interest only:

ServerName cld.site.in
RewriteEngine on
RewriteCond %{SERVER_NAME} =cld.site.in
RewriteRule ^ https:// %{SERVER_NAME}%{REQUEST_URI } [END,NE,R=permanent]

i.e. it is needed only for re-pushing to https, but only if the host is correctly registered,

if you contact xyz.site.in, it will remain on http and will drizzle that untrusted url (not Apache, but the site itself processes this)

in order to automate the receipt of the letsencrypt certificate for the rds site .site.in I want port 80 to be forwarded from the outside to my server depending on the url

right now, no ProxyPass \ ProxyPassReverse is registered and the site works

as competently in the only above config to register in order: if from the outside the url (http) contains rds.site.in/lalala/ this same request as it is without changes to the url and detected redirects was transmitted to " real" internal rds.site.in ? (and there it already has its own rewrite to https with a different port)
and, accordingly, if the url does not / does not contain "rds.site.in" was it processed as it is now?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Q
Quqas, 2021-02-09
@Quqas

I think I figured it out myself,
I just didn’t want to specify ip numbers
by domain, although it’s strange.
from cld console. ping rds. gives the correct ip
and from the outside "something went wrong" has not yet registered the numbers

<VirtualHost *:80>
        ServerName rds.site.in
        ProxyPreserveHost On
        ProxyPass / http://192.168.125.248/
        ProxyPassReverse / http://192.168.125.248/
</VirtualHost>

interposed in the beginning of a config
after there is an old as is.
works

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question