Home Grails. Redirect not working after CURL call from remote server
Reply: 0

Grails. Redirect not working after CURL call from remote server

user1467 Published in March 23, 2018, 9:03 am


I have an app working in a domain like this:


If I access to


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

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
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?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.318714 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO