我的网站无法在Safari iOS NGINX上运行

okxuctiv  于 2023-05-28  发布在  Nginx
关注(0)|答案(1)|浏览(210)

我使用VPS和Nginx托管我的网站。
一切都很正常,但在iOS...当我尝试访问我的网站时,Safari告诉我"Safari can’t establish a secure connection"
我不能得到它,我的SSL证书是工作无处不在,但在野生动物园。
下面是我的nginx配置:

server {
  server_name louislecouturier.fr www.louislecouturier.fr;

  location / {
    # this must stay localhost. The port must be the same as your Next.js project
    proxy_pass http://$server_addr:3000;
  }

  # simple headers
  add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
  add_header X-XSS-Protection          "1; mode=block" always;
  add_header X-Frame-Options DENY always;

  # this will serve the project on port 80

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/louislecouturier.fr/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/louislecouturier.fr/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {

  server_name api.louislecouturier.fr www.api.louislecouturier.fr;

  location / {

    proxy_pass http://$server_addr:1337;

  }

  # simple headers
  add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
  add_header X-XSS-Protection          "1; mode=block" always;
  add_header X-Frame-Options DENY always;

  # this will serve the project on port 80

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/louislecouturier.fr/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/louislecouturier.fr/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
    if ($host = www.louislecouturier.fr) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    if ($host = louislecouturier.fr) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

  server_name louislecouturier.fr www.louislecouturier.fr;
  listen 80;
    return 404; # managed by Certbot

}

server {
    if ($host = api.louislecouturier.fr) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


  server_name api.louislecouturier.fr www.api.louislecouturier.fr;
  listen 80;
    return 404; # managed by Certbot

}

我的SSL证书由certbot生成。你可以访问我的网站https://louislecouturier.fr
我读过一些与http 2的协议冲突可能会在safariiOS上产生错误,但我还没有手动配置我的服务器来使用它(也许是默认的?)
谢谢你的帮助!

pw136qt2

pw136qt21#

我找到解决办法了
结果发现,我只需在每个服务器上添加ipV6侦听器

listen [::]:80;
listen [::]:443;

相关问题