I am using the following php to switch between mobile and desktop versions of my site
$mobile_browser = '0';
if (preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|android)/i', strtolower($_SERVER['HTTP_USER_AGENT']))) {
$mobile_browser++;
}
if ((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml') > 0) or ((isset($_SERVER['HTTP_X_WAP_PROFILE'])
I just cannot seem to get the real client IP to show in PHP's $_SERVER['REMOTE_ADDR']. It shows in $_SERVER['X_FORWARDED_FOR'], but the $_SERVER['REMOTE_ADDR'] always points to the Varnish service IP.
I've played around with just about every Varnish vcl suggestion I could find. I've installed Apache module mod_rpaf.
In PHP, Remote file inclusion can be conducted via input from $_GET, $_POST, $_COOKIE. I know it is improbable, but is it possible (by any chance) to fake the value come out of $_SERVER?
I mean, can $_SERVER become the source of Remote file inclusion even on rare occasion?
I'm using nginx as a reverse proxy in front of an apache with mod_php. My site is on https, and it would require the variable $_SERVER['HTTPS'] to be set 'on' to assemble some of the links correctly.
My problem is that I'm setting up a reverse proxy and instead of getting content through my domain, I'm getting just a header redirect.
I am making simple application which based on phone's location. I am using this code for GPS location. In the main() function I am requesting the GPS location and then I am working with it. (I am calculating the sunrise and sunset)
I can get the location, but when I start the application I get the LastKnown location.
I have an nginx-based HTTP proxy and I would like to process all HTTP redirects inside it so that clients get only the last response in the redirect chain.
The basic code looks like:
location /proxy {
rewrite ^/proxy/([^/]+) $1 break;
proxy_pass http://$uri/;
}
My attempt at following 1 level redirects is this:
error_page 301 302 307 =200 @redir;
...
I have IIS 7 on Windows Server 2008, with PHP support (5.3.15)
I have noticed a difference compared to an Apache 2 environment, with the content of PHP variable $_SERVER['REQUEST_URI'].
Basically, on Apache we get exactly the same content as in the requested URL, but with IIS the URL seems already partially decoded ("+" signs instead of spaces are unchanged, but %XX characters get already decode
I have a website in IIS which has a .com extension. I've got a SSL certificate and set up the bindings to use HTTPS. This works fine
I've now set up a new website which has a .co.uk extension.