I posted this on the NUG as well, but it may or may not be more relevant
here:
I am having some problems with my Nginx reverse proxy. I'm running 4Dv15,
and Active4D 6.4r3, using the 4D server shell. I have successfully
configured two web roots in Active4D, which run on the same 4D Web Client,
on port 8010. I have two different host names which are pointed to the same
IP address. I'll call them name1.domain.com:8010 and name2.domain.com:8010.
These successfully resolve to the appropriate web root within Active4D,
when I put those two urls in my web browser.
I set up my proxy in nginx two different ways, and neither of them
consistently resolve to the right website:
1: I setup one upstream server and accessed it through proxy_pass from both
server definitions:
upstream 4d_webclient{
server 127.0.0.1:8010;
}
server {
listen 80;
server_name name1.domain.com;
location / {
root /location_1
proxy_pass http://4d_webclient;
...
}
}
server {
listen 80;
server_name name2.domain.com;
location / {
root /location_2
proxy_pass http://4d_webclient;
...
}
}
Please note that I'm just trying to get the reverse proxy to work. Once I
do that, I'll add SSL requirements, and all the necessary rewrites to make
sure people are redirected to our secured interface.
The second way I did it was to create a different upstream for each
website, using the DNS names for each, and then calling the appropriate
upstream proxy from each server definition:
upstream name1_server{
server name1.domain.com:8010;
}
upstream name2_server{
server name2.domain.com:8010;
}
... (the same as above, except replacing 4d_webclient with name1/2_server
at proxy_pass)
Both ways gave the same results. After restarting my Web Client and nginx
(just to make sure I start from a clean slate), both name1.domain.comand
name2.domain.com resolve to the name1:domain.com:8010 website. However, if
I go to name2.domain.com:8010, then both name1.domain.com and
name2.domain.com will resolve to that website. Going to
name1.domain.com:8010 then causes both portless addresses to resolve there,
until I visit name2.domain.com:8010 directly again.
Obviously, I don't understand the relationship between how nginx deals with
upstream declarations and how that passes along to Active4D. Any help would
be appreciated.
Doug
_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/