webapp behind reverse proxy nginx
-
Hi all,
i build a nginx reverse poxy and want to be able to to get to the webapp true the reverse proxy. i can reach the login site but afte that it cant find the page. This is what i have in nginx
This shows me the login page howver after i login the url is wrong.
Does anyone know how to fix this?
-
Hi,
I do not know nginx but for Apache2 you need 2 lines:
ProxyPass /webapp http://192.168.2.8/webapp ProxyPassReverse /webapp http://192.168.2.8/webapp
this also translates from https to http.
-
I believe your location should be
location /webapp/
Is the webserver for the webapp using https? The backend server often use only http…
-
Hi bern. it is strange i hope you can help me with this. i now have this
However now it is linking me to the nginx welcome page.
and im am using ssl (https) in the backend
The same thing happens for z-push. I installed ngixn zpush package but if i enter the url from my nginx it also links me to the welcome page.
-
@ckruijntjens said in webapp behind reverse proxy nginx:
d im am using ssl (https) in the backend
change the ip to hostname, and this is fixed.
If the backend is in https, then why try to connect over http?
client connect to webserver with ip, will enter some vhost, where this ip is configured.
client connect to webserver with hostname, will enter some vhost, where this hostname is configured.Now, for this connection, you might see these probley are 2 diffent vhosts.
or configure the vhost better, or use hostnames. -
Hi i am not connecting over http?
However if i change the ip to hostname i still being linked to the demo page.
-
@ckruijntjens it should be something like this:
location / { proxy_pass https://192.168.2.8/webapp; }
For further information you could read the docs:
http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass -
Hi when i use this i get the login page but after the login page not found /webapp/webapp
-
That’s because kopano redirects on login via PHP header
I don’t know if there is a better solution but on my Installation i simply have a redirect for this URL back to the right one -
How shouldthat redirect look like?
-
@ckruijntjens ,
You need to remove the /webapp from the proxy pass url and add it to the location.
location /webapp { proxy_pass https://192.168.2.8; }
Nginx is just adding the location behind the proxy_pass url this is why you get /webapp/webapp in the end
Just take a look at the Webmeetings manual there’s an example with WebApp behind a proxy https://documentation.kopano.io/web_meetings_manual/configuration.html#configuring-nginx
-
if i enter this i am directed to the nginx welcome page?
-
please check the nginx logs from both servers something should point you to the problem
-
hi can you post your rule of the redirect please. i can not get it working