Skip to content

Instantly share code, notes, and snippets.

@parkerproject
Created August 21, 2021 14:43
Show Gist options
  • Save parkerproject/62d3b4be367e6ecbb77d9c1799051818 to your computer and use it in GitHub Desktop.
Save parkerproject/62d3b4be367e6ecbb77d9c1799051818 to your computer and use it in GitHub Desktop.
# Protect WooCommerce upload folder from being accessed directly.
# You may want to change this config if you are using "Redirect Only" method for downloadable products.
# Place this config towards the end of "server" block in nGinx configuration.
location ~* /wp-content/uploads/woocommerce_uploads/ {
if ( $upstream_http_x_accel_redirect = "" ) {
return 403;
}
internal;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment