Yes -- this is possible:
merge_slashes off; location ~ /(?<r>http://.*) { resolver 127.0.0.1; proxy_pass $r; }
Whether you should do it is another matter. Having merge_slashes off may not be a good idea.
merge_slashes off