server { listen 443 ssl; server_name api.anjie-elec.cn; # use `server_name api.anjie-elec.*` if your server has problem starting nginx. (nginx: [emerg] host not found in upstream ) # You may use a self-signed certificate, or just use an invalid certificate. That's OK. ssl_certificate "yourPATH.yourCER.crt"; ssl_certificate_key "yourPATH/yourKEY.key"; location ~ /api/usewater/Add { proxy_pass http://localhost:25502; } location ~ /api/cashtopup/UpdateCardUsedAmount { proxy_pass http://localhost:25502; } location ~ /api/oauth/getaccesstoken { proxy_pass http://localhost:25502; } location ~ /api/users/MessageNumByMobile { proxy_pass http://localhost:25502; } location / { proxy_pass http://localhost:25502; } }