I deployed my nodejs https server on Azure
https.createServer(options, app).listen(8080, ()=>{console.log("listening on 8080")});
As you can see from the code snippet above it is listening on port 8080
How should i access my server on Azure websites?
https://myapp.azurewebsites.net/ or https://myapp.azurewebsites.net:8080/
Before giving the answer, here are some important concepts you should know about Azure Web App.
So you are supposed to use process.env.PORT
instead of 8080
and access your site with the url https://myapp.azurewebsites.net
. You can see the pipe if you output it in log.
More details about Azure Web App sandbox .
Besides, you can refer to this nodejs web app deploy tutorial and this app sample .
it seems that azure handles https
so there is no need for
https.createServer(options, app).listen(8080, ()=>{console.log("listening on 8080")});
just the standard
app.listen(process.env.port)
process.env.port is the azure provided port
also to set to use https only (that is all incoming http gets redirected to https) refer to
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.