Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to use nginx for proxying requests to my internal backend.

My configuration reads as follows:

location /Shibboleth.sso {
    proxy_pass internal-backend; # ip
    proxy_redirect off;

But, my redirects are always rewritten.. My backend returns a response like and my browser receives

How do I get nginx to just forward the response?

share|improve this question

I solved the problem. POUND (my ssl-proxy) by default automatically rewrites every location. I added

RewriteLocation 0

to the pound.cfg and finally it worked.

share|improve this answer

Here is my config:

  set $s3_bucket '<BUCKETNAME>';

  location / {
        send_timeout 5m;
        proxy_read_timeout 240;
        proxy_send_timeout 240;
        proxy_connect_timeout 240;
        proxy_http_version 1.1;
        proxy_set_header Host $s3_bucket;
        proxy_set_header Authorization '';
        proxy_hide_header x-amz-id-2;
        proxy_hide_header x-amz-request-id;
        proxy_ignore_headers "Set-Cookie";
        proxy_buffering off;
        proxy_intercept_errors on;
        proxy_redirect off;
        proxy_pass http://$s3_bucket;

Tested and working. It just passes the URI over to the S3 instance, allowing you to terminate the SSL connection at the proxy. Useful for firewalls and such that require a static IP; as the AWS address space is huge for white-listing purposes.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.