I know this kind of question have existing solutions , but none of them solve my problems
once I enter my web with prefix WWW , it displays such 403 error:
This is my Domain parse setting:
Domain parse setting screenshot
And this is my CDN setting screenshot, my server is Aliyun cloud. CDN setting screenshot
This is my Nginx configuration screenshot:
Nginx configuration screenshot
as you can see , I configure www.example.com
and example.com
in my Nginx , I also add CDN CNAME to www.example.com
and example.com
, I can access example.com
but cant access www.example.com
.
and I ping both of them , they can response normally with CDN domain address but different IP address, Here is the Ping screenshot
But I just can't access www.example.com
in browser , it is so wired.
BTW,this is my whole Nginx configure
mysite_nginx.conf
the upstream component nginx needs to connect to
upstream django_ {
# server unix:///path/to/your/mysite/mysite.sock; # for a file socket
server 127.0.0.1:8005; # for a web port socket (we'll use this first)
}
configuration of the server
server {
# the port your site will be served on
listen 80;
# the domain name it will serve for
server_name www.labtine.com labtine.com # substitute your machine's IP address or FQDN
charset utf-8;
# max upload size
client_max_body_size 75M; # adjust to taste
# Django media
location /media {
alias /home/cg_log/CG_log/media; # your Django project's media files - amend as required
}
location /static {
alias /home/cg_log/CG_log/static; # your Django project's static files - amend as required
}
# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass 127.0.0.1:8003;
include /etc/nginx/uwsgi_params; # the uwsgi_params file you installed
}
}