Update to detect current url on nginx properly.