Access cloudflare workers with Nginx proxy

Here is a reference link, which i am testing this project on:

http://test/

Right now its proxing through a test site, and if you http://test/cf-worker, it has configured to proxy https://test.proxy-cf-worker.workers.dev/

But instead gives 502 Bad Gateway.