这是我当前的nginx配置:
server {
listen *:80;
server_name upload.expert;
proxy_set_header Host upload.expert;
location / {
rewrite ^(.*)$ https://upload.expert$1 permanent;
}
}
server {
listen *:443 ssl;
server_name upload.expert;
proxy_set_header Host upload.expert;
location / {
proxy_pass http://localhost:3000;
}
}
https站点正常运行,http返回ERR_CONNECTION_REFUSED,怎么了?
答案 0 :(得分:0)
您可以像这样重定向(带有请求uri):
server {
listen *:80;
server_name upload.expert;
return 301 https://$host$request_uri;
}
server {
listen *:443 ssl;
server_name upload.expert;
proxy_set_header Host upload.expert;
location / {
proxy_pass http://localhost:3000;
}
}