[users@httpd] mod_rewrite or reverse proxy?

2018-06-05 Thread Ray Jender
 

So, I have an Ubuntu 16.04 server (host) with Apache 2.4.18

I have created 4 LXD containers on this server.

Each container has media server app installed.

I want to be able to access a container based on the input query.

 

So if I browse to http://  "host server"/LPC1,  I access
container 1.

If I browse to http://host server"/LPC2,   I access container 2.

 

Is this possible with mod_rewrite?

 

Note that the host and containers can ping each other's IP.

 

I want to be able to do something like this:

 

RewriteEngine on

Redirect "localhost/LPC1"  "rtmp://10.22.175.19:1935"

 

The host IP is DHCP (192.168.0.x) from my LAN and the container IP is DHCP
from LXD (10.x.x.x)

 

 

So,  10.22.175.19 is container 1.  How can someone on the internet access
the 10.22.175.19 container?

 

Hope I made sense with all this!

 

Thanks,


Ray 

 



[users@httpd] Mod_Rewrite and reverse proxy

2011-04-20 Thread Joel Donahue
Is it possible to use Mod_Rewrite and apache in reverse proxy mode
simultaneously?

I have a web server (server1) that is a mirror of another of another
web server (server2) and all requests from the server1 are reverse
proxyed to server2.
The robots.txt from server2 needs to be changed to disallow crawling
when accessed through server1.
So I created a robots2.txt, uploaded onto server2 and tried this
configuration on server1 but it is not working.



Directory /
RewriteEngine on
RewriteBase /
RewriteRule ^robots\.txt$ robots2.txt
/Directory

ProxyPass / http://www.server2/ retry=0
ProxyPassReverse / http://www.server2/
ProxyPreserveHost On


Any recommendations as to how to accomplish this are very much
appreciated. Thank you.

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Mod_Rewrite and reverse proxy

2011-04-20 Thread Mark Montague

 On April 20, 2011 18:43 , Joel Donahue joel.donahu...@gmail.com wrote:

Is it possible to use Mod_Rewrite and apache in reverse proxy mode
simultaneously?



Directory /
RewriteEngine on
RewriteBase /
RewriteRule ^robots\.txt$ robots2.txt
/Directory

ProxyPass / http://www.server2/ retry=0
ProxyPassReverse / http://www.server2/
ProxyPreserveHost On



Yes, but the Directory stanza applies to files that are being served 
from the front-end server's filesystem.  The rewrite rules you put in 
the Directory stanza have no effect because the requests are being 
proxied, not served from the filesystem.


Move the RewriteEngine and RewriteRule directives out of the Directory 
context and into the virtual host context with the ProxyPass directive.  
You should also get rid of the RewriteBase directive and make the 
RewriteRule directive operate on absolute (not relative) URLs, like this:


RewriteRule ^/robots\.txt$ /robots2.txt

--
  Mark Montague
  m...@catseye.org


-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Mod_Rewrite and reverse proxy

2011-04-20 Thread Joel Donahue
On Wed, Apr 20, 2011 at 4:58 PM, Mark Montague m...@catseye.org wrote:
  On April 20, 2011 18:43 , Joel Donahue joel.donahu...@gmail.com wrote:

 Is it possible to use Mod_Rewrite and apache in reverse proxy mode
 simultaneously?

 Directory /
 RewriteEngine on
 RewriteBase /
 RewriteRule ^robots\.txt$ robots2.txt
 /Directory

 ProxyPass / http://www.server2/ retry=0
 ProxyPassReverse / http://www.server2/
 ProxyPreserveHost On


 Yes, but the Directory stanza applies to files that are being served from
 the front-end server's filesystem.  The rewrite rules you put in the
 Directory stanza have no effect because the requests are being proxied,
 not served from the filesystem.

 Move the RewriteEngine and RewriteRule directives out of the Directory
 context and into the virtual host context with the ProxyPass directive.  You
 should also get rid of the RewriteBase directive and make the RewriteRule
 directive operate on absolute (not relative) URLs, like this:

 RewriteRule ^/robots\.txt$ /robots2.txt

 --
  Mark Montague
  m...@catseye.org



I just realized I wasn't replying to the list
Here is the config that got it working thanks to Mark's suggestions


VirtualHost *.*.*.*:80

ServerName server1
ServerAlias server1

ProxyPass / server2/ retry=0
ProxyPassReverse / server2/
ProxyPreserveHost On

RewriteEngine on
RewriteRule ^/robots\.txt$ /robots2.txt [PT]

/VirtualHost

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org