As some of you may know, we have been trying to fill a number of open positions available throughout the company. In our latest assault, we are going to publicise our vacancies as heavily as possible throughout our website — but targeted at the right audience.
As the majority of our open positions are based in Australia, we are initially targeting Australian visitors to see what impact the banner makes. Hopefully our Aussie customers who are enjoying using our software would also love to work for us. At least they know about our products and our values.
For those of you who are from the land of down under, you may have noticed that the website has been updated with a banner advertising the fact that we are hiring and how fun it is to work at Atlassian:
For those of you who are abroad, you will be none the wiser.
Why is that? The website has been updated to use Maxmind GeoIP. Basically, you feed it an IP address and it will check against the GeoIP database to determine the visitor’s location.
Unfortunately, implementing this on the website was not as straight forward as grabbing the IP address using the getRemoteAddr() method on the HttpServletRequest object.
From looking at the access logs on the production website, it looks like all the IP addresses logged by the website are coming from Contegix-land, our hosting partner. It turns out that because the website lives behind Apache and through the use of mod_proxy, the remote IP address is not being sent through the request as normal.
The saviour came in the form of Reverse Proxy Request Headers. After some investigation from Contegix, it turns out that when acting in a reverse-proxy mode, mod_proxy_http adds several request headers in order to pass information to the origin server. These headers are:
- X-Forwarded-For: The IP address of the client.
- X-Forwarded-Host: The original host requested by the client in the Host HTTP request header.
- X-Forwarded-Server: The hostname of the proxy server.
So looks like the “X-Forwarded-For” header in the request is the go. Once the website has been verified that it can read this header, the production website has been updated to display the jobs banner for all visitors from Australia.
So where to from here?
Knowing the location of your visitor’s IP address can be quite helpful. We can tailor the content on our website to suit particular markets.
For example, during the sign up process on the website, we have a field which asks the user which the country they are from. The main purpose of this field is to guide our Japanese users who wish to evaluate our software to Imahima, our Japanese partner.
Through the use of GeoIP, we will be able to determine where the user is from using their IP address and therefore remove the need to ask this question or pre-select the country.
The question remains is — how transparent do you want this to be? I am sure there are still some users who think that they are totally anonymous on the net and would freak out seeing the country field pre-populate with their location.