Caddy on payara/Glassfish systems

I have a problem with payara reverse proxy.

i need to redirect localhost: 8080/ EAapDashboard-war to

www. domain .com.

i use this caddy config file,

www. domain .com {
proxy / localhost:8080/EAapDashboard-war

the problem is, the www. domain. com is redirect to www. domain. com/EAapDashboard-war, and i need only have www. domain. com url., how i can redirect correctly?

I have always found that using web server config to fight with a backend application over what the path should be is difficult and unrewarding. :frowning2:

Because it’s important that we are using the same terminology here, I should note that your Caddy is not doing any redirecting. I guess your Payara application may be doing some URL rewriting, but none of that is coming from your Caddy.

I think the Caddyfile you’ve posted is already the best attempt you’ll get at using the web server to hide part of the backend path (unless someone else on the forums wants to step in with another suggestion I’m not aware of). Sorry I don’t have a good answer for you, but my strong recommendation is that you solve the path issue in the app itself, not the proxy.

I second what Matthew said; hiding the URL can be a little tricky but maybe what you want is the rewrite directive? (Not sure, and you’ll have to figure out exactly what you need, but maybe to point you in the right direction.) Rewrites and redirects are different; rewrites are internal only; the browser does not see rewrites, but it does see redirects.

I made a simple solution,

cuddy conf file:

www. domain .com {
proxy / www. domain .com:8080


on the payara virtual server bind the app, with the www. domain com, on 8080 http listener

so on the router, i bind 80 to 80 and 8080 to 8080.


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.