【发布时间】:2020-11-04 10:16:37
【问题描述】:
我想将我的域 http://example.com 重定向到 https://example.com
任何人都可以告诉我我做错了什么。
在此先感谢-----------:)
server {
listen 85;
listen [::]:85;
server_name example.com;
return 302 https://example.com$request_uri;
}
server {
listen 85 ;
listen [::]:85 ;
server_name example.com www.example.com; # managed by Certbot
location /static/ {
alias /home/shoaib/dir/static/;
}
location /media/ {
alias /home/shoaib/dir/media_root/;
}
location / {
include proxy_params;
proxy_pass http://unix:/run/car.sock;
}
listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
【问题讨论】: