我必须编写一些配置代码,但它不起作用。那么我要做什么来解决这个问题
server {
listen 3000;
listen 443 ssl;
server_name localhost;
ssl_certificate /nginx-1.15.12/ssl/server.crt; // own certificate
ssl_certificate_key /nginx-1.15.12/ssl/server.key; //own privatekey
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_pass https://10.0.0.4:3000; //my local IP with node js running port number
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /public {
root C:\Program-Files\iisnode\www\RSRK_BETA; // path of my node js application
}
}
我想运行 HTTPS
最佳答案
server {
listen 443 ssl;
server_name localhost;
ssl_certificate /path/to/cert-storage/cert-self-signed.com.crt;
ssl_certificate_key /path/to/cert-storage/cert-self-signed.com.key;
...
}
}
我正在 Linux 上运行 Node 10 + NGINX。我不确定操作系统是否会对 NGINX 本身产生影响。除了位置
设置之外,这就是我所拥有的一切,并且它有效。
关于node.js - 如何在windows中使用NGINX为node js配置HTTPS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55881104/