ssl redirect with nginx

Hi
I have to redirect http to https with nginx installation but with “return 301 https://domain.com$request_uri;” doesn’t works…
How can i do that?