finally got it
created a file in nginx (/etc/nginx/conf.d/elasticbeanstalk/01modrewrite.conf)
code :
location / {
try_files $uri $uri/ /index.php?$query_string;
# Remove from everywhere index.php
if ($request_uri ~* "^(./)index\.php(/?)(.)") {
return 301 $1$3;
}
}