Last active
September 5, 2024 01:48
-
-
Save jdevalk/9e6e275052d25d4ce8d6 to your computer and use it in GitHub Desktop.
NGINX config for @dannyvankooten's EDD SL API Endpoint code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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