Re: [users@httpd] Reverse proxy: redirect variable by user

2017-02-13 Thread Markus Rathgeb
Hi Nick,

> Otherwise, it would be pretty trivial to implement as a
> custom module.

Okay, I will have a look at.
I assume that is the starting point to use:
https://httpd.apache.org/docs/2.4/developer/modguide.html

>> * Dependend on the identifier (if logged in successfull) a host and
>> port should be chossen. I assume this could be realized by a simple
>> CGI script that (e.g. look into an database) and set host and port
>> session variables. That session variables should be visible (readable
>> / writable) by the server only (mod_session_dbd?).
>
> That won't work.  A CGI request is not a Proxy request.  They are
> separate backends to the server.

What won't work?
Let's assume all but a special location (e.g. /control) is proied.
The special location is handled locally.
This location could contain the login formular and CGI scripts.
The example 
"https://httpd.apache.org/docs/2.4/mod/mod_session.html#basicexamples;
seems that it is possible to inject variables.
But I assume you would point me that the server behing the proxy
cannot inject session variables to the session handled by HTTPD.
Correct?

Best regards,
Markus

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Reverse proxy: redirect variable by user

2017-02-11 Thread Nick Kew
On Sat, 11 Feb 2017 11:48:30 +0100
Markus Rathgeb  wrote:

> Short summary: It should be a reverse proxy that choose the redirect
> target URL by the logged in user

You can test REMOTE_USER in an  section or a RewriteRule.
With the latter, you can use it as a backreference with [P].
A RewriteMap could serve more complex mapping rules, but I
couldn't say in the abstract whether that approach would serve you.

Otherwise, it would be pretty trivial to implement as a
custom module.

> * Dependend on the identifier (if logged in successfull) a host and
> port should be chossen. I assume this could be realized by a simple
> CGI script that (e.g. look into an database) and set host and port
> session variables. That session variables should be visible (readable
> / writable) by the server only (mod_session_dbd?).

That won't work.  A CGI request is not a Proxy request.  They are
separate backends to the server.

-- 
Nick Kew

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Reverse proxy: redirect variable by user

2017-02-11 Thread faysal7eman
User name: faysal0e...@gmail.com password: etietieti0173. This is Samsung user 
I'd n password


Sent from my Samsung Galaxy smartphone.
 Original message From: Markus Rathgeb  
Date: 11/02/2017  4:48 p.m.  (GMT+06:00) To: users@httpd.apache.org Subject: 
[users@httpd] Reverse proxy: redirect variable by user 
Hi,
I would like to realize an idea using the Apache HTTP Server project.
As I am a beginner at this topic, it would be great if you could give
me some help.

If my reading is correct it should be possible at all.

Short summary: It should be a reverse proxy that choose the redirect
target URL by the logged in user

* If a connection is made to the server (and the user is not logged
it), he needs to fill out a formular and give some informations
(identifier, username, password). I assume this could be realized by
"AuthType form", session, ... (perhaps database lookup using a CGI
script)

* Dependend on the identifier (if logged in successfull) a host and
port should be chossen. I assume this could be realized by a simple
CGI script that (e.g. look into an database) and set host and port
session variables. That session variables should be visible (readable
/ writable) by the server only (mod_session_dbd?).

* If the user is logged in every request should be proxied to another
web server (proxy, redirect [P]) and the host and port information
should be used for.
e.g. http://${HOST}:${PORT}/

* At least this should be work for WebSockets, too.

Do you think this is possible?
Can you help me with the configuration?

Best regards,
Markus

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Reverse proxy: redirect variable by user

2017-02-11 Thread Faysal Eman
It proxy marks are empty.and not shows up address

On 11 Feb 2017 4:48 p.m., "Markus Rathgeb"  wrote:

> Hi,
> I would like to realize an idea using the Apache HTTP Server project.
> As I am a beginner at this topic, it would be great if you could give
> me some help.
>
> If my reading is correct it should be possible at all.
>
> Short summary: It should be a reverse proxy that choose the redirect
> target URL by the logged in user
>
> * If a connection is made to the server (and the user is not logged
> it), he needs to fill out a formular and give some informations
> (identifier, username, password). I assume this could be realized by
> "AuthType form", session, ... (perhaps database lookup using a CGI
> script)
>
> * Dependend on the identifier (if logged in successfull) a host and
> port should be chossen. I assume this could be realized by a simple
> CGI script that (e.g. look into an database) and set host and port
> session variables. That session variables should be visible (readable
> / writable) by the server only (mod_session_dbd?).
>
> * If the user is logged in every request should be proxied to another
> web server (proxy, redirect [P]) and the host and port information
> should be used for.
> e.g. http://${HOST}:${PORT}/
>
> * At least this should be work for WebSockets, too.
>
> Do you think this is possible?
> Can you help me with the configuration?
>
> Best regards,
> Markus
>
> -
> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
> For additional commands, e-mail: users-h...@httpd.apache.org
>
>