首頁  >  問答  >  主體

nginx不帶www可以正常訪問,www網域不能正常訪問

一旦造訪www網域就會跳到網域存取提示

網域已經解析www了,以下是nginx.conf

user              nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;

pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';    
    access_log  /var/log/nginx/access.log  main;
    sendfile        on;
    #tcp_nopush     on;
    #keepalive_timeout  0;
    keepalive_timeout  65;
    #gzip  on;
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*.conf;
}

sites-enabled

server {
    listen 80;
    server_name www.youzisq.com youzisq.com;

    location / {
        proxy_pass http://127.0.0.1:5050;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}
PHP中文网PHP中文网2713 天前575

全部回覆(1)我來回復

  • phpcn_u1582

    phpcn_u15822017-05-16 17:17:57

    業者進行的DNS跳轉,最可能的原因就是網域名稱沒有解析,或是網域的解析結果還沒生效。請檢查網域解析的TTL,到網路上查查當地的解析情況,試試看清空本地的DNS快取。

    回覆
    0
  • 取消回覆