docksal / docksal

Unified, Docker 🐳 powered web development environments for macOS, Windows, and Linux
https://docksal.io
MIT License
687 stars 179 forks source link

Add Documentation Around Geolocation Development #741

Open sean-e-dietrich opened 6 years ago

sean-e-dietrich commented 6 years ago

When doing local development for server side geolocation based services it can be hard as the IP address that comes back is not a public IP.

Simple way

IPIFY be implemented so that the requests coming in have a valid IP address:

Example:

Create a prepend.php

<?php
$_SERVER['REMOTE_ADDR'] = file_get_contents('https://api.ipify.org');

In php.ini

auto_prepend_file = /var/www/.docksal/etc/php/prepend.php
shelane commented 5 years ago

@sean-e-dietrich Is this a good candidate for the new advanced use cases section of the documentation? Is there anything else that needs to be added regarding what you would be trying to do specifically?