Help

2

403 (Forbidden) Response on Google Maps API in contact form

Avatar
Demian Rihs

Hi,

I can't see the map thumbnail in my contact form anymore. I just see a missing image icone although the link is working. In my Browser console I get this error message

GET http://maps.googleapis.com/maps/api/staticmap?sensor=false&zoom=8&center=Via+Pratocarasso+56%2C+Bellinzona+6500%2C+Svizzera&size=298x298 403 (Forbidden)


I am using nginx to redirect all the web traffic from port 80 to 8069 and all links that are "company.com" to "www.company.com" could nginx cause the issue?

6 Comments
Avatar
Discard
Avatar
Demian Rihs
-

maybe this has something to do with it? http://stackoverflow.com/a/11353159

Avatar
Ermin Trevisan
-

I do have the same problem with one of my domains: www.gastrosoftware.ch/page/contactus but it works flawlessly with others such as www.flohmarkt-zug.ch/page/contactus

I'm using caddyserver (www.caddyserver.com) as proxy server for both and I have to investigate the cause.

Avatar
Ermin Trevisan
-

I did check again, I do have the same vhost configuration for both, I do have defined the web.base.URL system parameter defined the same for both. The only difference: the one working is delivered using cloudflare, the other one not working does not use cloudflare :-(

Avatar
Demian Rihs
-

I am hosting my odoo instance on an Amazon EC2 instance routing the DNS from my swiss server. I don't know about cloudfare

Avatar
Ermin Trevisan
-

Both of my domains are hosted on the same DNS hosting provider (hoststar.ch) on the same own Amazon EC2 instance on the same Odoo instance using dbfilter.

Avatar
youta
-

I'm facing the same issue with images, were you able to solve it?

1 Answer
1
Avatar
Prosper Guena Nitcheu
Best Answer

For static maps, you have to :
1-  Enable your project at this url :
https://console.developers.google.com/apis/api/static_maps_backend/overview?project= 

2-  Generate an API Key on the same url 

3-  On odoo, create a system parameter with key = google_maps_api_key and value = [value of API Key generate above]

2 Comments
Avatar
Discard
Avatar
Demian Rihs
-

Hello, thanks for your instructions! I tried this steps but still couldn't get the maps to show up again. It doesn't depends on my host, I also tried with different ones and I get the same results.

Avatar
Ermin Trevisan
-

It does work as described, but you have to enable the corresponding APIs properly.