Reverse proxy one domain

mrodrigom nginx-forum at forum.nginx.org
Thu Apr 25 13:16:09 UTC 2019


Hi.
I have one URL for all my websites, applications and so.
Let's say it's system.mydomain.com. Most of my websites is Apache + PHP and
the applications is Tomcat. So far so good, no problem there.

My nginx config that's working for everything else:

server {
        listen 80;
        server_name system.mydomain.com;
        ....................
        location /app1 {
                return 301 https://$host$request_uri;
        }
}
server {
        listen 443 ssl;
        server_name system.mydomain.com;
        ....................
        location /app1 {
                proxy_pass              http://app1.mydomain.com;
        }
}
upstream app1.mydomain.com {
        server          SERVER_IP_HERE:8081        fail_timeout=60;
}

Ok, my problem is when I have Alfresco for example on the backend. Alfresco
responds on (fictional IP) "http://192.168.0.10/share".
I need to acess my nginx reverse proxy (another machine in front of
Alfresco) on the URL: "http://system.mydomain.com/alfresco" and it should
consume "http://192.168.0.10/share".
In my configuration above, the error is that when I acess
"http://system.mydomain.com/alfresco" it will consume
"http://192.168.0.10/alfresco".
How can I configure this to work? Rewrite?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,283919,283919#msg-283919



More information about the nginx mailing list