在Nginx服务器上不起作用的自签名ssl证书。
这是/etc/nginx/nginx.conf
user fatboy;
http {
default_type application/octet-stream;
include /etc/nginx/mime.types;
server {
location / {
proxy_pass http://localhost:8080/;
}
}
server{
listen 443;
ssl on;
ssl_certificate /home/fatboy/public.pem;
ssl_certificate_key /home/fatboy/key.pem;
location / {
proxy_pass http://localhost:8080/;
}
}
}
worker_processes 5;
events {
worker_connections 2000;
}
这是sudo ufw状态:
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
443 DENY Anywhere
Nginx Full ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
443 (v6) DENY Anywhere (v6)
Nginx Full (v6) ALLOW Anywhere (v6)
对于自签名证书,我使用了以下命令:
openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out public.pem -subj "/C=US/ST=Oregon/L=Portland/O=Company Name/OU=Org/CN=www.bux-bot.ru"
答案 0 :(得分:0)