Since the system using .htaccess for the referral link direction, it will work properly on the apache server. If you want to use nginx you need to create a redirection from the id/ folder to the id/index.php?ref=[username]
Example: /id/sdvsdvsdv it should redirect to id/index.php?ref=sdvsdvsdv
location /id/ {
rewrite ^(.*)$ /index.php?ref=$1;
}