【发布时间】:2017-01-27 08:12:16
【问题描述】:
这是我的 yo_nginx.conf 文件:
upstream django {
server unix:///home/ubuntu/test/yo/yo.sock; # for a file socket, check if the path is correct
}
# Redirect all non-encrypted to encrypted
server {
server_name 52.89.220.11;
listen 80;
return 301 https://52.89.220.11$request_uri;
}
# configuration of the server
server {
# the port your site will be served on
listen 443 default ssl;
# the domain name it will serve for
server_name 52.89.220.11; # substitute your machine's IP address or FQDN
charset utf-8;
ssl on;
ssl_certificate /etc/ssl/certs/api.ajayvision.com.chain.crt;
ssl_certificate_key /etc/ssl/private/api.ajayvision.com.key;
# max upload size
client_max_body_size 75M; # adjust to taste
# Finally, send all non-media requests to the Django server.
location / {
proxy_set_header X-Forwarded-Proto https;
include /home/ubuntu/test/yo/uwsgi_params;
uwsgi_param UWSGI_SCHEME https;
uwsgi_pass_header X_FORWARDED_PROTO;
uwsgi_pass django;
}
}
我想要做的就是在我的 django 应用程序上实现 SSL,但是当我打开域时,它会在正常的 HTTP 端口中打开。此外,当我使用 https 打开域时,它会说检查您的连接。我的 conf 文件中是否缺少某些内容?另外,我没有设置代理。
【问题讨论】: