Can I running a different domain in the front of app engine via revers proxy?

102 views
Skip to first unread message

Xin Huang

unread,
Oct 19, 2018, 6:07:48 PM10/19/18
to Google App Engine
I want to use multiple domains for an application. I set up a simple application in GAE and prepared another server for the reverse proxy. 
The proxy config looks like:
{{{
HOSTNAME:80 {

  header_upstream Host APP-ID.appspot.com;
  header_upstream X-Real-IP {remote}
  header_upstream X-Forwarded-For {remote}
  header_upstream X-Forwarded-Proto {scheme}
}
}
}}}

I have no luck here. I get a 400 error.
{{{
<html><title>Error 400 (Bad Request)!!1</title></html>
}}}

Do you know is there any way to set a reverse proxy for GAE? Thanks.

Attila-Mihaly Balazs

unread,
Oct 21, 2018, 1:24:10 AM10/21/18
to Google App Engine
I don't think you can send those X headers to GAE (X-Real-IP and so on). Other than that it should certainly work since multiple people have reported using this technique to work around the "GAE using custom domains in considerably slower than GAE using the appspot domain" issue (especially in the Asia regions).

So, yes, you will loose the "original IP" information, but other than that it should work.

Attila

Xin Huang

unread,
Oct 21, 2018, 8:58:19 AM10/21/18
to Google App Engine
Thank you for the answer. I tried it can work when I remove the 'HOST' rewrite.

在 2018年10月21日星期日 UTC-4上午1:24:10,Attila-Mihaly Balazs写道:

Harmit Rishi (Cloud Platform Support)

unread,
Oct 23, 2018, 11:10:55 AM10/23/18
to Google App Engine

Hello,


It seems your issue of being able to use custom domains with a reverse proxy (in front of GAE ) has been answered and accepted by you already. However, if you would like to further investigate what other Request Headers are available on GAE you can go to the following:


For Google App Engine - Standard:

You can find Request Headers for Standard here.


For Google App Engine - Flexible:

You can find Request Headers for Flex here.


As mentioned in the previous post, they are some X headers that you have included that cannot be sent. However, if you have built your GAE app on Flexible then you can include the following headers:


X-Forwarded-For: [CLIENT_IP(s)], [global forwarding rule IP]

X-Forwarded-Proto [http | https]


Reply all
Reply to author
Forward
0 new messages