I got a bit further:
location / {
if ( $args ~* "s2member_paypal_notify" ) {
set $args "optimizemember_paypal_notify";
rewrite ^.*$ https://www.domain.org/ permanent;
}
try_files $uri $uri/ /index.php?$args;
}
This is working now for the IPN - however I noticed that if I enter e.g.
www.domain.org/?s2member_paypal_notify=1
the redirect goes to
www.domain.org/?optimizemember_paypal_notifiy
(missing the =1). So i think even though it is working - I'm missing a little bit here.