错误的nginx或DNS配置?

时间:2016-04-24 11:21:59

标签: nginx dns

我在digitalocean上部署了一个网站,其中nginx作为proxypass。该网站有效,但有时我必须刷新才能到达该网站。我担心我的nginx或我的DNS配置是错误的,因为我第一次这样做。

这是我的nginx配置:(服务器应该只在https上运行)

   server {
      listen 80;
      server_name <site_name>.com;
      return 301 https://www.<site_name>.com$request_uri;
   }

   server {
      listen 80;
      server_name www.<site_name>.com;
      return 301 https://www.<site_name>.com$request_uri;
   }

   server {
      listen 443 ssl;
      server_name <site_name>.com;

      # FORGE SSL (DO NOT REMOVE!)
      ssl_certificate /etc/nginx/ssl/certs/ssl-bundle.crt;
      ssl_certificate_key /etc/nginx/ssl/certs/private.key;
      return 301 $scheme://www.<site_name>.com$request_uri;
   }

   server {
      listen 443;
      server_name www.<site_name>f.com;

      fastcgi_connect_timeout 300;
      fastcgi_send_timeout 300;
      fastcgi_read_timeout 300;

      ssl on;
      ssl_certificate /etc/nginx/ssl/certs/ssl-bundle.crt;
      ssl_certificate_key /etc/nginx/ssl/certs/private.key;

      ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
      ssl_ciphers ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!AESGCM;
      ssl_prefer_server_ciphers on;
      ssl_session_cache shared:SSL:10m;
      ssl_session_timeout 10m;

      location / {
         proxy_pass http://localhost:8000;
      }
   }

以下是我的dns设置:

记录主持人:@值:TTL:自动

记录主持人:www值:TTL:1分钟

知道出了什么问题吗?

THX!

1 个答案:

答案 0 :(得分:0)

当网站无法加载错误消息时,如果有的话?我怀疑这是一个DNS问题,因为它有时会工作