Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Google App Engine from serving from appspot.com

I'm serving my app from a custom domain. I don't want it to be available at the appspot.com domain. What's the easiest way to achieve this? I'd like to be able to do it at the console level, but I have feeling I'll have to configure it in the app. The app is written in Java. Thanks.

like image 880
keith.uk Avatar asked Jan 23 '26 21:01

keith.uk


1 Answers

If you want to completely deny any access via the appspot domain.

Use a custom ServletFilter to check the HttpServletRequest.getRequestURL() to see if it matches the appspot.com domain and return a 404 Not Found.

The filters are applied in the order they are listed in the web.xml so make sure this one is the first one.