# \[Solved\] Safari failing in SSL with Ngnix as reverse proxy

**URL:** <https://forum.mattermost.com/t/solved-safari-failing-in-ssl-with-ngnix-as-reverse-proxy/370>\
**Category:** Troubleshooting\
**Created:** [October 17, 2015, 1:21am UTC](https://forum.mattermost.com/t/solved-safari-failing-in-ssl-with-ngnix-as-reverse-proxy/370 "2015-10-17T01:21:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradford88](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/bradford88/32/173_2.png) [@bradford88](https://forum.mattermost.com/u/bradford88)\
**Post date:** [October 17, 2015, 1:21am UTC](https://forum.mattermost.com/t/solved-safari-failing-in-ssl-with-ngnix-as-reverse-proxy/370/1 "2015-10-17T01:21:43Z")

</div>

I can access my MM server with any browser and it works great in SSL except safari (Mobile or Desktop). It fails with a generic 50X Server unexpectedly dropped the connection error. I use SSL on my Nginx reverse proxy with a CertCom cert.

If I browse locally (not encapsulated in SSL) or disable the SSL, it works fine. All my other SSL sites work fine. So it’s localized to my Nginx or SSL config for the specific site.

I see 2 errors I think may be a symptom.

[EROR] websocket connect err: web socket: could not find connection header with token ‘upgrade’

[EROR] /api/v1/websocket:connect code=500 rid=[random characters] uid=[random characters] ip=192.168.1.10 Failed to upgrade web socket connection [details:]

=========================NGINX CONFIG====================

map $http\_upgrade $connection\_upgrade {  
default upgrade;  
’’ close;  
}

upstream mattermost {  
server 17.0.0.50:8065;  
}

server{  
listen 80;  
server\_name \_\_\_\_\_\_\_\_\_\_.com;  
return 301 https://$server\_name$request\_uri;  
}

server{  
listen 443 ssl;  
server\_name \_\_\_\_\_\_\_\_\_\_\_\_\_.com;

```
access_log	/var/log/nginx/chat-access.log;
error_log /var/log/nginx/chat-error.log;
   
ssl on;
ssl_certificate /etc/nginx/certs/chat/ssl.crt;
    ssl_certificate_key /etc/nginx/certs/chat/dssl.key;
ssl_session_timeout 5m;
ssl_prefer_server_ciphers on;
    ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

location / {
    proxy_pass http://192.168.1.2:8065;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
client_max_body_size 4G;
keepalive_timeout 10;
}

```

}

---

<div class="post-metadata">

**Author:** ![jarrettlenox](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/jarrettlenox/32/176_2.png) [@jarrettlenox](https://forum.mattermost.com/u/jarrettlenox)\
**Post date:** [October 18, 2015, 10:07pm UTC](https://forum.mattermost.com/t/solved-safari-failing-in-ssl-with-ngnix-as-reverse-proxy/370/2 "2015-10-18T22:07:08Z")

</div>

Any chance you’re using Cloudflare or another proxy?

See: [Cloudflare and websockets with SSL (free Cloudflare accounts block websocket connection)](http://forum.mattermost.com/t/cloudflare-and-websockets-with-ssl/375)

---

<div class="post-metadata">

**Author:** ![bradford88](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/bradford88/32/173_2.png) [@bradford88](https://forum.mattermost.com/u/bradford88)\
**Post date:** [October 19, 2015, 2:30am UTC](https://forum.mattermost.com/t/solved-safari-failing-in-ssl-with-ngnix-as-reverse-proxy/370/3 "2015-10-19T02:30:36Z")

</div>

I’m just using Nginx as my reverse proxy. There aren’t any more proxies in my set-up. Although that error is similar

---

<div class="post-metadata">

**Author:** ![bradford88](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/bradford88/32/173_2.png) [@bradford88](https://forum.mattermost.com/u/bradford88)\
**Post date:** [October 19, 2015, 5:14pm UTC](https://forum.mattermost.com/t/solved-safari-failing-in-ssl-with-ngnix-as-reverse-proxy/370/4 "2015-10-19T17:14:17Z")

</div>

I got it. This serverfault post suggested that the poster add

ssl\_session\_cache shared:SSL:10m;

to the global Nginx config file, and it eliminated my problem as well.

http [serverfault.com](http://serverfault.com) /questions /646142 /ssl-proxying-on-nginx-different-behavior-in-different-clients  
(had to chop it up. it’s not letting me post any links since i’m a new user)
