简单的Nginx 302redirect不起作用

我试图得到一个简单的redirect在我的nginx服务器上工作。 我收到302响应代码,但Location标题未设置。 我错过了什么?

我最小的情况(与一个硬编码的图像):

 location /redirectme { return 302 https://www.google.com/logos/doodles/2016/childrens-day-2016-brazil-5739205150900224-hp2x.jpg; } 

我的实际使用案例(将用户redirect到传递给url查询参数的url ):

 location /redirectme { return 302 $arg_url } 

我尝试的另一个configuration(手动设置位置标题):

 location /redirectme { add_header Location $arg_url; return 302; } 

这些都没有实际的redirect客户端到新的URL(只返回302)。 我的networking应用程序的其余部分很好,只是不是这个redirect片。 如果它有所作为,我正在一个ssl server {...}块内工作。 有任何想法吗? 谢谢!

—–更新——

这是整个server块…

 server { listen 443; server_name myserver.com; access_log /path-to/myserver.com-ssl.access.log; ssl on; ssl_certificate /path-to/myserver.com.crt; ssl_certificate_key /path-to/myserver.com.key; ssl_client_certificate /path-to/clientkey.pem; ssl_verify_client on; ssl_verify_depth 1; keepalive_timeout 5; root /srv/www/myserver/public/; location /redirectme { return 302 $arg_url; } location / { try_files $uri/index.html $uri/index.htm @unicorn; } location @unicorn { proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-CLIENT-VERIFY $ssl_client_verify; proxy_redirect off; proxy_read_timeout 60; proxy_send_timeout 60; # If you don't find the filename in the static files # Then request it from the unicorn server if (!-f $request_filename) { proxy_pass http://unicorn_myserver.com; break; } } error_page 500 502 503 504 /500.html; location = /500.html { root /srv/www/myserver/public/; } } 

而从curl -i的回应curl -i

 HTTP/1.1 302 Found Content-Type: application/json Content-Length: 0 Connection: keep-alive Date: Fri, 14 Oct 2016 18:37:32 GMT x-amzn-RequestId: 44e865b2-923d-11e6-a60a-5f6291eee9a8 X-Cache: Miss from cloudfront Via: 1.1 aa89533ad2ec5e0edba466c9920bd000.cloudfront.net (CloudFront) X-Amz-Cf-Id: 7dzQ9JQK380hFD-nFyJxm6mIWT5D4mWzvCbSAhDaa-pHwpF4oZHszw== 

这也可能是相关的(我不明白如何,但也许),我的亚马逊API网关坐在我的请求前,直接代理他们到我的服务器(注意: ssl_client_certificate /path-to/clientkey.pem;是configuration为只接受来自API网关的请求)。