How can I remove a port from url for node app using nginx

0 votes

My front end is divided in two parts. Part of it is on react and the other is an angular app. Both are using node/express app on port 3000. I use express-static feature on browser to dynamically handle UI to render react or angular on server.js.

I required it to run using https://example.com (which I handled using "nginx proxy"). But now it's accessible using both https://example.com:3000/ and https:example.com. I want it to be accessed only using https;//example.com without the port.

The server's api can be accessed from the places(https://example.com:3000/api/ver1)

1) ios app 
2) admin app (running differently)
3) and UI(Reactjs+angularjs)  (https://example.com)

Note- We have tried creating a separate node server for UI but that approach will cost us more. Is there any other way to achive this.

Apr 10, 2018 in DevOps on Cloud by Damon Salvatore
• 5,430 points
330 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

If you run your node server on 0.0.0.0, it becomes accessible globally.

Change yours listening port from:

app.listen(3000)

to

app.listen(3000, '127.0.0.1');

You can also block this port in IPTables as well.

answered Apr 10, 2018 by ajs3033
• 7,080 points

Related Questions In DevOps on Cloud

0 votes
1 answer
0 votes
2 answers
0 votes
1 answer

Can i include custom data in a AWS cloudwatch alarm

You would have routied the alert event ...READ MORE

answered Aug 2, 2018 in DevOps on Cloud by Kalgi
• 36,260 points
27 views
0 votes
1 answer
0 votes
1 answer
+13 votes
2 answers
0 votes
1 answer

How to control development/prod/staging application settings using azure functions?

You should use a build-release system like ...READ MORE

answered May 10, 2018 in DevOps on Cloud by ajs3033
• 7,080 points
186 views
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.