淡淡烟草味2017-06-24 09:46:27
Reverse proxy is not enough
server{
listen 443;
location / {
proxy_pass http://my_node_app;
}
}
迷茫2017-06-24 09:46:27
server {
listen 80;
server_name my.domain.com;
[....]
}
server {
listen 443 ssl;
server_name my.domain.com;
return 301 http://$server_name$request_uri;
}
Simplified Nginx configuration file, the author can refer to it
曾经蜡笔没有小新2017-06-24 09:46:27
You can listen to port 443, and then redirect in this listening == Haha, I guess, I have never done this. . .
三叔2017-06-24 09:46:27
Use wildcards to match the corresponding route and then jump
server {
# 省略部分...
listen 443;
server_name domain.com;
# 如果后端接口格式类似这样的话 /api/users /api/login
location ^~ /api/ {
proxy_pass http://domain.com:12345;
}
}
为情所困2017-06-24 09:46:27
The backend must provide https access to redirect.
So you need to apply for a legal certificate and configure nginx to provide https protocol.
However, there is no need to jump in this way, just add https protocol.