nginx can be accessed normally without www, but the www domain name cannot be accessed normally
PHP中文网
PHP中文网 2017-05-16 17:15:57
0
1
618

Once you access the www domain name, you will jump to Domain name access prompt

The domain name has resolved www, the following is 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讲师

reply all(1)
phpcn_u1582

The most likely reason for the DNS jump performed by the operator is that the domain name has not been resolved, or the resolution result of the domain name has not yet taken effect. Please check the TTL of domain name resolution, check the local resolution online, and try clearing the local DNS cache.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template