Skip to content

Instantly share code, notes, and snippets.

@aric49
Created August 16, 2018 15:37
Show Gist options
  • Select an option

  • Save aric49/f0cc28c862a68c67c595ae8579f3a579 to your computer and use it in GitHub Desktop.

Select an option

Save aric49/f0cc28c862a68c67c595ae8579f3a579 to your computer and use it in GitHub Desktop.
NGINX FastCGI Debugging
<?php
//print out values of variables
var_dump($_SERVER[‘REMOTE_ADDR’]);
var_dump($_SERVER[‘HTTP_X_FORWARDED_FOR’]);
?>
location ~ ^(.+\.php)(.*)$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
fastcgi_intercept_errors on;
fastcgi_pass mysite-web-php:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi.conf;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS on;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment