I am using nodejs and expressjs. I wonder if there is something like request.headers.protocol in the clientRequest object. I would like to build the baseUrl for
If you are using Proxy Server such as Nginx you should set proxy_set_header X-Forwarded-Proto https; in its config file, so if you are using TSL express could recognize https as req.headers['x-forwarded-proto'] value or true for req.secure