我正在尝试将HTTP重定向到HTTPS。我的默认端口是nginx上的81。
server {
listen 81;
server_name deveshvyas.in;
return 307 https: //deveshvyas.in$request_uri;
}
server {
listen[::]: 443 ssl http2;
listen 443 ssl http2;
#
ssl_code
server_name deveshvyas.in;
ssl_certificate / etc / nginx / ssl / nginx.crt;
ssl_certificate_key / etc / nginx / ssl / nginx.key;
location / {
proxy_pass http: //127.0.0.1:3000;
}
}
https工作正常,但重定向失败