-3

I want my godaddy subdomain to redirect to my API server on Google cloud.
Added the subdomain, did the redirect, but the thing is that the POST requests are getting to my webserver as GET requests.

Didn't find any documentation on how to make godaddy forward the requests as is

Boaz
  • 405
  • 1
  • 11
  • 16
  • Where exactly did you do the redirect? And why don't you point the domain directly to your API server? – Tero Kilkanen Apr 02 '14 at 09:46
  • I want the subdomain to redirect to my server, and keep the website itself on the godaddy server. I defined the subdomain as my server's IP address – Boaz Apr 02 '14 at 10:06
  • I meant, in what place did you do the redirect? And why won't you point the subdomain directly to the API server? – Tero Kilkanen Apr 02 '14 at 11:16
  • That's exatcly what I did... Under Domains->Forwarding->Subdomain (now it is manage)-> setting in there: Subdomain: app, Forward to: http://XX.XX.XX.XX Redirect type: 302 (Temporary) Forward settings: Forward only – Boaz Apr 02 '14 at 11:20
  • That is a redirect. Set up a DNS A record for your subdomain, that points to the IP address of your app server. – Tero Kilkanen Apr 02 '14 at 11:23
  • nice... and how do I keep a subdomain and cancel it's forwarding? – Boaz Apr 02 '14 at 11:29
  • OK got it - @TeroKilkanen if you want to write it as an answer I will accept it... – Boaz Apr 02 '14 at 11:32

2 Answers2

2

In order to pass the request directly to the server, you should use a DNS A record to configure the site. A redirect is a HTTP level mechanism which makes lose POST information.

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63
1

There is a confusion here. GoDaddy offer several services and you have two of them mixed up:

  1. DNS.
  2. HTTP redirects.

With DNS, when you point a domain (or subdomain) at an IP address, a client types that domain into their browser, the browser looks up the IP address and sends the request to that IP address (your web server).

With HTTP redirects (which GoDaddy calls Forwarding), the client types in the domain and the IP address they get back is GoDaddy's web server's IP address. They send the request to that IP address and that web server responds with a 302 redirect response that tells the client to make a new request to your IP address.

Due to ambiguity/misinterpretation with the original HTTP RFC, the follow up request is always a GET request, even if the original was a POST request. To remove this ambiguity, newer HTTP RFCs have added the 303 and 307 redirect codes. I don't know if GoDaddy offers these codes as choices when forwarding.

To solve your problem, don't use Forwarding. Go to the Zone editor in the GoDaddy web interface and point your subdomain directly at your IP address. (If "Google Cloud" requires a CNAME entry pointing at a domain they control, you can do that in the Zone Editor too.)

Ladadadada
  • 26,337
  • 7
  • 59
  • 90
  • Thanks for the detailed answer. Since it was given after @ToroKilkanen actually answered in a comment, I will respect him and give him the accepted answer if he will provide one. Thanks again! – Boaz Apr 02 '14 at 11:34