Skip to content

Instantly share code, notes, and snippets.

@jdevalk
Last active August 29, 2015 14:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdevalk/9e6e275052d25d4ce8d6 to your computer and use it in GitHub Desktop.
Save jdevalk/9e6e275052d25d4ce8d6 to your computer and use it in GitHub Desktop.
NGINX config for @dannyvankooten's EDD SL API Endpoint code
if ( $query_string ~ "^edd_action=" ) {
set $edd_api 1;
}
if ( $request_uri ~ "^/edd-sl-api" ) {
set $edd_api 2;
}
if ( $edd_api = 1 ) {
return 307 https://example.com/edd-sl-api$request_uri;
}
location ~ .php$ {
if ( $edd_api = 2 ) {
access_log /var/log/nginx/example.com-edd-sl-api.log;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment