nginx不带www可以正常访问,www域名不能正常访问
PHP中文网
PHP中文网 2017-05-16 17:15:57
0
1
565

一旦访问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中文网

认证高级PHP讲师

全部回复(1)
phpcn_u1582

运营商进行的DNS跳转,最可能的原因就是域名没有解析,或者说是域名的解析结果还未生效。请检查域名解析的TTL,到网上查查当地的解析情况,试试清空本地的DNS缓存。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!