I HAVE EDITED THE QUESTION TO SIMPLIFY IT
I have an app working in a domain like this:
http://localhost:8092/myapp
If I access to
http://localhost:8092/myapp/ticket/save
with a browser, everything goes fine. However, if I make a CURL call from command line to another controller, and from there I try to redirect to the controller "ticket" method "save", as shown in the URL above, it works only if the call is made from localhost. But if I made the call from a remote server it won't do anything.
This is the curl call:
curl --location http://192.168.1.18:8092/myapp/trans/index
and the index method:
def index() {
print "index"
redirect(controller: "ticket", action:"save")
}
When making the call from a remote client, Grails won't do the redirection and it does not show any error. However, in the terminal, it says:
curl --location http://192.168.1.18:8092/Post-editor_Grails/traduccion/index
curl: (7) couldn't connect to host
BUT the call does reach the server, as "index" gets printed in Grails console. So I asume that error comes from the redirection.
I have tried to set absolute:true in the redirect, as shown here:
Grails redirect with reverse proxy
but it does not work either.
Any ideas?