How make the Google Cloud Storage Bucket as a static-website Visible With and Without www? - google-app-engine

Hello to everybody after all correct configurations as I followed at the "Documentation of Google Cloud Storage - Configuring a Bucket as a Static Website" my bucket it work as a website but the problem is about the prefix WWW in fact when I visit the bucket http://www.pieropretti.net I can see the content of the public bucket, but if I visit (from the browser Chromium version 42.0.2281.0 (64-bit) and same problem from the browser FirefoxESR 31.4.0 (Tor Browser 4.0.3) without the prefix WWW I receive the error server not found. This is the screenshot of the domain name DNS configuration in the picture here http://tinyurl.com/ncoc9y5

"www.pieropretti.net" and "pieropretti.net" are different domain names, and thus also correspond with different buckets. If you want to serve content from "pieropretti.net", you will need to create a bucket named exactly "pieropretti.net" in the same way you created the "www.pieropretti.net" bucket.
From what I can see, the DNS setting for "pieropretti.net." doesn't seem to have a CNAME, despite what your panel is telling you. Perhaps it just hasn't propagated to me yet.

From DNS records I notice that you are on OVH, if it is you can use the OVH Redirection Technology to redirect from naked to WWW.
If you are on other maintainers don't worry all offers service like OVH for redirect the naked to the www.

For top-level domain name we can't add CNAME, we can add A record, so I goto my Terminal and ping c.storage.googleapi.com to get the IP address, then I use the IP address to add into the A record, it works for me, just not sure whether it's an appropriate way to do it this way or not, but it just works for me.

Related

Using Google App Engine URL patterns to reach non-default service

According to [this doc][1] I should be able to reach a non-default service through URL patterns.
I am using a custom domain. (site.com) This is working to reach the default service.
I want to reach a second, non-default service called my-service.
According to the docs, it seems like this is the way to do it:
my-service.site.com
However, this isn't working. I understand I can use a dispatch.yaml file, but I would like to set it up just by the URL's if possible.
How do I set this up correctly?
Edit: The exact error (url replaced) is this:
This site can’t be reached
my-service.site.com’s server IP address could not be found.
[1]: https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed#default_routing
The URL pattern you are using is correct. This problem is a DNS issue for "site.com". It appears that while you have mapped "site.com" to App Engine, subdomains are not mapped to App Engine, thus the DNS lookup is failing.
You either need to ensure that you have a wildcard entry in place for site.com, eg:
*.site.com. 3599 IN CNAME ghs.googlehosted.com.
Or map the specific service subdomain(s) to Google.
my-service.site.com. 3599 IN CNAME ghs.googlehosted.com.
This maps requests to subdomains of "site.com" to Google's servers.
Further details are in the documentation here.

Serve Files From Naked Root Domain

I run Google Ads on my Google-App-Engine-hosted website (www.bigriddles.com), and they tell me I need to have an "ads.txt" file served from the root domain (i.e. http://bigriddles.com/ads.txt, as opposed to http://www.bigriddles.com/ads.txt).
My DNS is hosted on Gandi, and I created their "ALIAS" record (which I think just does CNAME flattening or something similar) to alias "bigriddles.com" to "ghs.googlehosted.com." I chose "ghs.googlehosted.com" because that's what I CNAMEd "www.bigriddles.com" to (many years back), and that CNAME has been working fine.
However, now when I visit "bigriddles.com", I get an "HTTP 301 Moved" to "www.bigriddles.com", and as far as I can tell, this response isn't coming from any code I wrote (I've looked through my code and don't see anything that would redirect this). Furthermore, there is a "Server: ghs" header in the response from "bigriddles.com", whereas if I visit "www.bigriddles.com", which works fine, the response includes the header "Server: Google Frontend". I'm not sure if there is some hint of my problem in the difference between those two Server headers.
Anyway, I'm not sure exactly what's going wrong. It could be a DNS issue. I say this because "dig www.bigriddles.com" comes back with the IP 172.217.14.115, whereas "dig bigriddles.com" comes back with "172.217.168.211", so maybe one of these really is a "ghs" server and the other is a "Google Frontend" server (I'm not sure the difference) and this "ALIAS" DNS solution just isn't going to work.
More likely though I feel like maybe there is just some settings problem with my App itself where it's not set up to allow the apex domain "bigriddles.com", and if I change that setting it will start working?
I have gone through the steps on https://cloud.google.com/appengine/docs/standard/python/mapping-custom-domains. When I view the "Custom Domains" for my project, I see "www.bigriddles.com" and "m.bigriddles.com", but I don't see the naked domain "bigriddles.com". However, when I try to add it on that page, it tells me that "bigriddles.com" is already mapped to a project, so I'm not sure what to make of that.
Any help would be appreciated, thank you!
This seems like an issue with your domain provider.
You can use this tool that might help you contact the domain provider with detailed info.
If they insist it's not an issue on their side (I strongly believe it is), then you should contact Google Cloud Platform Support so a deeper inspection can be made on your project.
If you're also using G Suites for your domain, the criminal is G Suites' Domain -> Redirect. If it is, it's a pity that Google does not let us turn off the so-called feature.
Since G Suites use as the same entry point as App Engine, you have no chance to solve this other than moving your site outside Google services or stop using G Suite.

Why GAE naked custom domain stopped working

I've a running Django app served on Google App Engine standard under a custom domain: mysite.com.
My site was running pretty well for days but suddenly it stopped serving content using the custom domain.
In summary:
www.mysite.com => works
mysite.com => stopped working
There were no changes in either the DNS nor the app deployment.
What I've tried:
First I checked the DNS lookup for these names:
a) nslookup my-app.appspot.com <== the GAE canonical site name
b) nslookup mysite.com <== custom domain FAILING, ip resolved
c) nslookup www.mysite.com <== custom domain working, ip resolved
d) nslookup ghs.googlehosted.com <== the recommended GAE DNS entry for www subdomain
Surprisingly not only all the names are resolved correctly but also they map to different IP addresses.
Actually, c) and d) map to the same IP (as expected). Anyway its not a DNS problem as stated here.
Second, I checked GAE settings to see the custom domain and tried to add another domain: mysite.com. But it claimed it was already mapped.
Third, according to this answer:
- I deleted the naked domain mapping and re-added later.
Fourth, I've checked documentation and don't find any missing thing in my setup:
https://cloud.google.com/appengine/docs/standard/python/mapping-custom-domains?hl=en#top_of_page
Both naked (mysite.com) and 'www.mysite.com' custom domains were working for days!
The current behavior is a bit weird. Running:
wget mysite.com
Produces:
Connecting to mysite.com (mysite.com)|xxx.yyy.zzz.ddd|:443... connected
Then it hangs for a while and ends with Unable to establish SSL connection.
The same happens using the web browser.
Anyone facing the same problem?
Any help is appreciated.
In case it is useful for someone else:
The problem has gone away suddenly, after an hour or so.
The only change I am aware of is to delete and register again the mysite.com custom domain entry in the GAE Web cloud console.
The naked domain is now working perfectly.
To avoid getting your site offline:
How to be alerted about your site's availability
Enable Stackdriver monitoring by entering into
https://console.cloud.google.com/monitoring
Create an uptime check using your site URL
In Policies: Create an alert policy to be notified by email or app push messages.

I need help getting a custom domain on google apps to work

For several years I had custom domain working for my app on google apps. A year ago they changed the way data is stored forcing me to move to a different application name. Since then I have been unable to map the custom domain to my new google app.
Google developers console shows that I have added the 4 A records and the 4 AAAA records they ask for
I also added a CName record and when I ping www.erlandanderson.com it shows ghs,googlehosted.com
When I hit the naked domain I get ERR_NAME_NOT_RESOLVED. When I hit the domain prefixed with www I get a 404 error.
the site can be accessed as http://erland-anderson2.appspot.com/ and it works.
Any bright ideas
You should make sure your domain is 'verified domain' with web-master tools. Then, you need to map both IPv4 and IPv6 addresses because parts of AppEngine is running on IPv6 and you cannot control it. Last comes the CNAME mapping of your app URI to ghs.googlehosted.com Once these three things are correct, you will be able to access your app over a custom domain.
i just took a look at your dns records (erlandanderson.com i presume). These are my findings:
You have a cname set up for your www subdomain, so that should work as long as you have "www.erlandanderson.com" setup as domain in your developers console
I cannot see the A or AAAA records on your bare domain
I see that you have the A and AAAA records for the wildcard (*) in your dns settings. Meaning everything except www (since it has a different config) is correctly configured. Note that there is a difference between *.youdomain.com and yourdomain.com. If you want to configure the latter you usually leave the subdomain part empty or put an '#' instead. So....
You need to add the A and AAAA records for the # entry in your dns configuration.

Getting a forwarded URL from thousands of different domains in Google App Engine

I actually asked this question before, but I cannot get my account details back, so I'm asking again:
I have a series of different domain names that I would like to all point (via URL forwarding from my domain host) to a google app engine application that reads what the forwarding URL is. So if the domain typed in was original XYZ.com, then when I am forwarded to my application, I can return what that original domain name was. I'm using the python variant. How best can I do this without coding for each and every variant?
So for example I might have aaa.com and bbb.com and ccc.com that all should point to the same appspotdomain, and I wish to somehow determine what the referring URL was. I have thousands of domains and I have URL forwarding set-up. So unless I put something in the header is there a smart way to pull out the referring URL. I have tried the os.environ["SERVER_NAME"] route but this just gives the app-engine domain.
Try
os.environ['HTTP_REFERER']
or
self.request.headers['Referer']
Be careful though, it might not always be available.

Resources