Skip to content

Instantly share code, notes, and snippets.

@jdevalk
Last active September 5, 2024 01:48
Show Gist options
  • Select an option

  • Save jdevalk/9e6e275052d25d4ce8d6 to your computer and use it in GitHub Desktop.

Select an option

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