Skip to content

Instantly share code, notes, and snippets.

@mphillips
Last active August 16, 2019 14:03
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mphillips/6834a4996c1e2247a6f90351956e29d5 to your computer and use it in GitHub Desktop.
Save mphillips/6834a4996c1e2247a6f90351956e29d5 to your computer and use it in GitHub Desktop.
SAML 2.0 Single Sign-On WordPress Plugin Fix for Nginx
# 1) Edit the site's nginx config (/etc/nginx/custom-sites/site-name.conf) to add the lines below.
# 2) Reload nginx: sudo service nginx reload
server {
# existing conf here
# Nginx fix for the SAML 2.0 Single Sign-On plugin.
location ^~ /wp-content/plugins/saml-20-single-sign-on {
location ~ ^(?<script_name>.*?\.php)(?<path_info>/.*)?$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$script_name;
fastcgi_param PATH_INFO $path_info;
fastcgi_param PATH_TRANSLATED $document_root$path_info;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}
}
<?php
/*
Plugin Name: SAML 2.0 Single Sign-On
Version: 0.9.4
Plugin URI: http://keithbartholomew.com
Description: Authenticate users using <a href="http://rnd.feide.no/simplesamlphp">simpleSAMLphp</a>.
Author: Keith Bartholomew
Author URI: http://keithbartholomew.com
*/
// Comment out this line that shouldn't be here:
// define('WP_DEBUG', true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment