2 x Applications using the same domain behind a reverse proxy

2022-07-17 Thread Mik J via nginx
Hello, I don't manage to make my thing works although it's probably a classic for Nginx users. I have a domain https://example.org What I want is thishttps://example.org goes on reverse proxy => server1 (10.10.10.10) to the application /var/www/htdocs/app1https://example.org/app2 goes on reverse

Re: 2 x Applications using the same domain behind a reverse proxy

2022-07-18 Thread Ian Hobson
Hi Mik, I think the problem is that your back end cannot distinguish app1 from app2. I don't think there is a need for proxy-pass, unless it is to spread the load. I would try the following approach: Change the root within location / and location /app2 and serve static files directly. When

Re: 2 x Applications using the same domain behind a reverse proxy

2022-07-19 Thread Mik J via nginx
Hello Ian, Thank you for your answer. I did what you told me Now I have on my reverse proxy location / {     proxy_pass  http://10.10.10.10:80;     proxy_redirect  off;     proxy_set_header    Host    $http_host;     proxy_set_header

Re: 2 x Applications using the same domain behind a reverse proxy

2022-07-25 Thread Mik J via nginx
Hello everyone, I'm still trying to solve my implementation. When I access to example.org, I was to use /var/www/htdocs/app1 and it works. When I access to example.org/app2, I was to use /var/www/htdocs/app2 and it doesn't really work.     location / {   try_files $uri $uri/ /index.p

Re: 2 x Applications using the same domain behind a reverse proxy

2022-07-26 Thread Francis Daly
On Tue, Jul 26, 2022 at 01:11:45AM +, Mik J via nginx wrote: Hi there, I don't have a full answer, but a few config changes should hopefully help with the ongoing diagnosis. > When I access to example.org, I was to use /var/www/htdocs/app1 and it works. > > When I access to example.org/app2

Re: 2 x Applications using the same domain behind a reverse proxy

2022-07-26 Thread Ian Hobson
Hi Mik, I am no expert on nginx, just a user, and I have never had to split a site as you are. That said, I think the error is that you have wrapped your locations inside each other. This means that when it matches /, it goes on to pass .php files to app1, without ever looking for /app2. You