Skip to content

Instantly share code, notes, and snippets.

Ralph xralphack

Block or report user

Report or block xralphack

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:a0077d3667cea2541db18ecf6e5819da
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
View php helper
function getScriptNameFromPath($path)
{
$pathElements = explode('/', $path);
$scriptName = end($pathElements);
reset($pathElements);
return $scriptName;
}
@xralphack
xralphack / laravel.conf
Created Apr 26, 2017
nginx conf for laravel
View laravel.conf
# the following directive in your site configuration will direct all requests to the index.php front controller
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# use phpfpm to process .php files
@xralphack
xralphack / nginx whitelist for facebook
Created Jul 14, 2016
Force auth in nginx except for facebooks crawler.
View nginx whitelist for facebook
server{
satisfy any;
# https://developers.facebook.com/docs/ApplicationSecurity/#facebook_scraper
allow 31.13.24.0/21;
allow 31.13.64.0/18;
allow 66.220.144.0/20;
allow 69.63.176.0/20;
allow 69.171.224.0/19;
allow 74.119.76.0/22;
You can’t perform that action at this time.