Question

http2 with nginx not working with Safari

Hello guys,

My https site cannot be displayed in Safari with “nsposixerrordomain:100” error. I’m running nginx 1.13.3 and Ubuntu 17.04. The site is displayed fine in other browsers and the SSL test also completes fine (A+). When I disable the http2 from server block, it displays fine in Safari.

Thanks for any useful info.

Config:

server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
root /var/www/domain.com;
index index.php index.html index.htm;
server_name domain.com www.domain.com;
location / {
#try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php$is_args$args;
}
ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem; # managed by Certbot
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_ecdh_curve secp384r1;
ssl_stapling on;
ssl_stapling_verify on;
ssl_dhparam  /etc/nginx/ssl/dhparam.pem;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 180m;
ssl_session_tickets off;
add_header Strict-Transport-Security "max-age=31536000;
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
http2_max_field_size 16k;
http2_max_header_size 32k;
http2_recv_buffer_size 32k;
#includeSubDomains" always;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
server {
listen         80;
listen    [::]:80;
server_name    domain.com www.domain.com;
return         301 https://$server_name$request_uri;
}

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Apparently Safari doesn’t like multiple line HTTP headers under HTTP/2.

If above config has been copy and pasted right, the your HSTS header looks wrong since it opens quotes but doesn’t close it until multiple lines later. Fix that and it should work.

Hi, Thanks for the suggestion. It worked! Many thanks again, Michael

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel