# Nginx upstream https not proxing other pages(?)

**URL:** <https://www.ruby-forum.com/t/nginx-upstream-https-not-proxing-other-pages/244839>\
**Category:** NGINX\
**Created:** [June 23, 2016, 11:26am UTC](https://www.ruby-forum.com/t/nginx-upstream-https-not-proxing-other-pages/244839 "2016-06-23T11:26:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [June 23, 2016, 11:26am UTC](https://www.ruby-forum.com/t/nginx-upstream-https-not-proxing-other-pages/244839/1 "2016-06-23T11:26:34Z")

</div>

Having odd situation, even don’t know how to search in google, how to  
describe it…Anyway I’m using Nginx and proxy’ing https traffic to  
upstream  
server. Everything is fine with http (with others domains) but can’t get  
it  
to work with https…

Here is my nginx config

upstream umarket { server 192.168.2.11:443; }

# Upstream

server {  
listen 80;  
listen 443 ssl http2;  
server\_name umarket.lt;

```
error_log /var/log/nginx/umarket.lt_error.log;

add_header Strict-Transport-Security "max-age=31536000";

ssl on;
ssl_certificate

```

/etc/nginx/ssl/umarket.lt/umarket\_lt\_chained.crt;  
ssl\_certificate\_key /etc/nginx/ssl/umarket.lt/server.key;  
ssl\_session\_cache builtin:1000 shared:SSL:10m;  
ssl\_protocols TLSv1 TLSv1.1 TLSv1.2;  
ssl\_ciphers  
HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;  
ssl\_prefer\_server\_ciphers on;

```
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For 

```

$proxy\_add\_x\_forwarded\_for;  
proxy\_set\_header X-Forwarded-Proto https;  
proxy\_next\_upstream error timeout invalid\_header http\_500  
http\_502 http\_503 http\_504;  
proxy\_ssl\_session\_reuse off;  
proxy\_cache\_bypass $http\_secret\_header;  
proxy\_ignore\_headers Set-Cookie;  
proxy\_ignore\_headers Cache-Control;

```
location = / {

    proxy_pass $scheme://umarket;

}

```

}

Here screenshot whats happening…[http://i.stack.imgur.com/3CQc0.png](http://i.stack.imgur.com/3CQc0.png)

Posted at Nginx Forum:

> **[Nginx upstream https not proxing other pages(?)](https://forum.nginx.org/read.php?2,267806,267806#msg-267806)**
>
> Having odd situation, even don't know how to search in google, how to describe it...Anyway I'm using Nginx and proxy'ing https traffic to upstream server. Everything is fine with http (with others domains) but can't get it to work with https... Here...

---

<div class="post-metadata">

**Author:** ![romkaltu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ac91a4/32.png) [@romkaltu](https://www.ruby-forum.com/u/romkaltu)\
**Post date:** [June 23, 2016, 12:19pm UTC](https://www.ruby-forum.com/t/nginx-upstream-https-not-proxing-other-pages/244839/2 "2016-06-23T12:19:44Z")

</div>

My config wotk fine with ssl proxy pass

location / {

```
  proxy_pass https://backend;

  proxy_redirect off;

  proxy_next_upstream error timeout invalid_header http_502 http_503

```

http\_504;

```
  proxy_connect_timeout 120s;

  proxy_set_header Host $host;

  proxy_set_header X-Real-IP $remote_addr;

  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

  proxy_set_header X-Forwarded-Proto $scheme;

}

```

2016-06-23 12:26 GMT+03:00 romkaltu [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![romkaltu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ac91a4/32.png) [@romkaltu](https://www.ruby-forum.com/u/romkaltu)\
**Post date:** [June 23, 2016, 1:29pm UTC](https://www.ruby-forum.com/t/nginx-upstream-https-not-proxing-other-pages/244839/3 "2016-06-23T13:29:27Z")

</div>

What is your backend server? Maybe problem can persist in backend? I’m  
using  
Litespeed web server.

Posted at Nginx Forum:

> **[Re: Nginx upstream https not proxing other pages(?)](https://forum.nginx.org/read.php?2,267806,267815#msg-267815)**
>
> Having odd situation, even don't know how to search in google, how to describe it...Anyway I'm using Nginx and proxy'ing https traffic to upstream server. Everything is fine with http (with others domains) but can't get it to work with https... Here...

---

<div class="post-metadata">

**Author:** ![romkaltu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ac91a4/32.png) [@romkaltu](https://www.ruby-forum.com/u/romkaltu)\
**Post date:** [June 23, 2016, 1:30pm UTC](https://www.ruby-forum.com/t/nginx-upstream-https-not-proxing-other-pages/244839/4 "2016-06-23T13:30:38Z")

</div>

> Having odd situation, even don’t know how to search in google, how to  
> describe it…
> 
> location = / {  
> proxy\_pass $scheme://umarket;  
> }

Change location = / {} to location / {} because the = / means only that  
particular request (just the index page) will be proxied

> **[Module ngx\_http\_core\_module](http://nginx.org/en/docs/http/ngx_http_core_module.html#location)**
>
> This directive appeared in version 1.11.8.

rr

---

<div class="post-metadata">

**Author:** ![romkaltu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ac91a4/32.png) [@romkaltu](https://www.ruby-forum.com/u/romkaltu)\
**Post date:** [June 23, 2016, 1:48pm UTC](https://www.ruby-forum.com/t/nginx-upstream-https-not-proxing-other-pages/244839/5 "2016-06-23T13:48:44Z")

</div>

Yep this is it, just wanted to update status as somebody from  
serverfault  
already told me that 🙂

Posted at Nginx Forum:

> **[Re: Nginx upstream https not proxing other pages(?)](https://forum.nginx.org/read.php?2,267806,267818#msg-267818)**
>
> Having odd situation, even don't know how to search in google, how to describe it...Anyway I'm using Nginx and proxy'ing https traffic to upstream server. Everything is fine with http (with others domains) but can't get it to work with https... Here...

---

<div class="post-metadata">

**Author:** ![romkaltu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ac91a4/32.png) [@romkaltu](https://www.ruby-forum.com/u/romkaltu)\
**Post date:** [June 23, 2016, 2:04pm UTC](https://www.ruby-forum.com/t/nginx-upstream-https-not-proxing-other-pages/244839/6 "2016-06-23T14:04:31Z")

</div>

Also: no need to secure front-end to back-end proxy\_pass to backend  
with  
port :80

Posted at Nginx Forum:

> **[Re: Nginx upstream https not proxing other pages(?)](https://forum.nginx.org/read.php?2,267806,267820#msg-267820)**
>
> Having odd situation, even don't know how to search in google, how to describe it...Anyway I'm using Nginx and proxy'ing https traffic to upstream server. Everything is fine with http (with others domains) but can't get it to work with https... Here...
