# Proxy SSL redirects

**URL:** <https://www.ruby-forum.com/t/proxy-ssl-redirects/158312>\
**Category:** NGINX\
**Created:** [January 21, 2009, 11:24pm UTC](https://www.ruby-forum.com/t/proxy-ssl-redirects/158312 "2009-01-21T23:24:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pavel\_Ivashkov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/9f8e36/32.png) [@Pavel\_Ivashkov](https://www.ruby-forum.com/u/Pavel_Ivashkov)\
**Post date:** [January 21, 2009, 11:24pm UTC](https://www.ruby-forum.com/t/proxy-ssl-redirects/158312/1 "2009-01-21T23:24:46Z")

</div>

Hello all,

I have configured nginx-0.7.31 to proxy SSL requests (see config  
below; and yes - I need SSL on the back-end as well as on the  
front-end).

While it perfectly works for cia back-end, I have an issue with  
paypal: the first request to [https://ahchoo:2443/](https://ahchoo:2443/) redirects user to  
[https://www.paypal.com/](https://www.paypal.com/).

Any suggestions on what have I missed?

# nginx.conf:

worker\_processes 1;  
error\_log logs/error.log debug;

events {  
worker\_connections 1024;  
}

http {  
include mime.types;  
default\_type application/octet-stream;

```
access_log logs/access.log;

sendfile on;
keepalive_timeout 65;

#gzip on;

upstream paypal {
  server www.paypal.com:443;
}
upstream cia {
  server www.cia.gov:443;
}

server {
    listen 2443;
    server_name ahchoo;

    ssl on;
    ssl_certificate ssl/ahchoo.crt;
    ssl_certificate_key ssl/ahchoo.key;

    location / {
        proxy_pass https://paypal;
        proxy_redirect default;
    }
}

```

# }

---

<div class="post-metadata">

**Author:** ![Pavel\_Ivashkov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/9f8e36/32.png) [@Pavel\_Ivashkov](https://www.ruby-forum.com/u/Pavel_Ivashkov)\
**Post date:** [January 22, 2009, 9:11am UTC](https://www.ruby-forum.com/t/proxy-ssl-redirects/158312/2 "2009-01-22T09:11:17Z")

</div>

On Thu, Jan 22, 2009 at 12:14:17AM +0200, Pavel Ivashkov wrote:

> Any suggestions on what have I missed?
> 
> ```
> ssl on;
> ssl_certificate ssl/ahchoo.crt;
> ssl_certificate_key ssl/ahchoo.key;
> 
> location / {
> proxy_pass https://paypal;
> proxy_redirect default;
> 
> ```

You should either use

```
         proxy_pass https://www.paypal.com/;
         proxy_redirect default;

```

without upstream block, or

```
         proxy_pass https://paypal;
         proxy_redirect https://www.paypal.com/ /;

```

as  
proxy\_redirect default;

means in this case

```
         proxy_redirect https://paypal /;
```

---

<div class="post-metadata">

**Author:** ![Pavel\_Ivashkov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/9f8e36/32.png) [@Pavel\_Ivashkov](https://www.ruby-forum.com/u/Pavel_Ivashkov)\
**Post date:** [January 22, 2009, 11:06am UTC](https://www.ruby-forum.com/t/proxy-ssl-redirects/158312/3 "2009-01-22T11:06:56Z")

</div>

Hello Igor,

Thank you, that helped.

Thursday, January 22, 2009, 10:00:38 AM, you wrote:

IS\> You should either use

IS\> proxy\_pass [https://www.paypal.com/](https://www.paypal.com/);  
IS\> proxy\_redirect default;

IS\> without upstream block, or

IS\> proxy\_pass [https://paypal](https://paypal);  
IS\> proxy\_redirect [https://www.paypal.com/](https://www.paypal.com/) /;

IS\> as  
IS\> proxy\_redirect default;

IS\> means in this case

IS\> proxy\_redirect [https://paypal](https://paypal) /;
