New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem using Reverse Proxy in the latest release from branch master (stable) #1182

Open
enrique-quinteros opened this Issue Mar 8, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@enrique-quinteros

enrique-quinteros commented Mar 8, 2016

Hello, I have downloaded the latest release from the branch master (https://github.com/cherokee/webserver/archive/master.zip). I've compiled the source and installed Cherokee without a problem. However when I tried to use the Reverse Proxy functionality in this release (I had 1.2.103 previously installed), Cherokee doesn't proxy the context properly.

Example:

  • I configured a new Directory called "/website"
  • This should proxy to one of the information source as "/website"
  • The GET Request arrives as "/" to the source

This behavior didn't happen in previous releases.

Something really weird happens when I disable the Directory Rule and I let the request go through the Default Rule, it works properly.

So I think It has something to do specifically with the Directory Rule.

Please if anyone can give me some guide to solve this problem, I will really appreciate it. Thanks.

@skinkie

This comment has been minimized.

Show comment
Hide comment
@skinkie

skinkie Mar 8, 2016

Member
Member

skinkie commented Mar 8, 2016

@enrique-quinteros

This comment has been minimized.

Show comment
Hide comment
@enrique-quinteros

enrique-quinteros Mar 10, 2016

Hello skinkie, thank you for the quick reply, yes the source is configured with an IP Address

source!1!env!PHP_FCGI _CHILDREN = 5
source!1!env!PHP_FCGI_MAX_REQUESTS = 490
source!1!env_inherited = 0
source!1!host = 127.0.0.1:47990
source!1!interpreter = /usr/bin/php-cgi -b 127.0.0.1:47990
source!1!nick = PHP Interpreter
source!1!type = interpreter
source!2!host = 196.11.10.99:7001
source!2!nick = Weblogic 8.1
source!2!type = host
source!3!host = 196.11.10.195:7001
source!3!nick = Weblogic 8.1 Server 2
source!3!type = host

Should I use a DNS name instead?

Regards...

enrique-quinteros commented Mar 10, 2016

Hello skinkie, thank you for the quick reply, yes the source is configured with an IP Address

source!1!env!PHP_FCGI _CHILDREN = 5
source!1!env!PHP_FCGI_MAX_REQUESTS = 490
source!1!env_inherited = 0
source!1!host = 127.0.0.1:47990
source!1!interpreter = /usr/bin/php-cgi -b 127.0.0.1:47990
source!1!nick = PHP Interpreter
source!1!type = interpreter
source!2!host = 196.11.10.99:7001
source!2!nick = Weblogic 8.1
source!2!type = host
source!3!host = 196.11.10.195:7001
source!3!nick = Weblogic 8.1 Server 2
source!3!type = host

Should I use a DNS name instead?

Regards...

@skinkie

This comment has been minimized.

Show comment
Hide comment
@skinkie

skinkie Mar 10, 2016

Member

No. The IP is the requirement. My tip would be change the Directory match to a regular expression like: ^/website/.*

The behavior as you describe above is the correct behavior. With directory it should not include /website only the last part of the path.

Member

skinkie commented Mar 10, 2016

No. The IP is the requirement. My tip would be change the Directory match to a regular expression like: ^/website/.*

The behavior as you describe above is the correct behavior. With directory it should not include /website only the last part of the path.

@enrique-quinteros

This comment has been minimized.

Show comment
Hide comment
@enrique-quinteros

enrique-quinteros Mar 11, 2016

Thanks! it worked with regular expressions, i had to add one more rule though (bold text):

vserver!2!rule!201!match = or
vserver!2!rule!201!match!left = request
vserver!2!rule!201!match!left!directory = /website
vserver!2!rule!201!match!left!request = ^/website/.*
vserver!2!rule!201!match!right = request
vserver!2!rule!201!match!right!request = ^/website

I don't know why the rule directory is still in the conf (italic text), I deleted it with the admin.

Do you know what is the problem with the directory rule?

enrique-quinteros commented Mar 11, 2016

Thanks! it worked with regular expressions, i had to add one more rule though (bold text):

vserver!2!rule!201!match = or
vserver!2!rule!201!match!left = request
vserver!2!rule!201!match!left!directory = /website
vserver!2!rule!201!match!left!request = ^/website/.*
vserver!2!rule!201!match!right = request
vserver!2!rule!201!match!right!request = ^/website

I don't know why the rule directory is still in the conf (italic text), I deleted it with the admin.

Do you know what is the problem with the directory rule?

@skinkie

This comment has been minimized.

Show comment
Hide comment
@skinkie

skinkie Mar 11, 2016

Member
Member

skinkie commented Mar 11, 2016

@enrique-quinteros

This comment has been minimized.

Show comment
Hide comment
@enrique-quinteros

enrique-quinteros Mar 21, 2016

But that behavior is for the latest version? Because I had two cherokee servers with 1.2.103 and both work with the directory rule and they do work well:

-> Version 1.2.103: directory = /website/sub/file.xhtml --- proxy as ---> /website/sub/file.xhtml
-> Version Latest: directory = /website/sub/file.xhtml --- proxy as ---> /sub/file.xhtml
-> Version Latest: directory = /website/website/sub/file.xhtml -- proxy as --> /website/sub/file.xhtml

Is it posible that something has changed between versions?

Regards,

enrique-quinteros commented Mar 21, 2016

But that behavior is for the latest version? Because I had two cherokee servers with 1.2.103 and both work with the directory rule and they do work well:

-> Version 1.2.103: directory = /website/sub/file.xhtml --- proxy as ---> /website/sub/file.xhtml
-> Version Latest: directory = /website/sub/file.xhtml --- proxy as ---> /sub/file.xhtml
-> Version Latest: directory = /website/website/sub/file.xhtml -- proxy as --> /website/sub/file.xhtml

Is it posible that something has changed between versions?

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment