Run Node JS Project Without Port in URL
We can remove PORT from URL in Node JS project from server configuration files
So we have mainly two types of server base:
So you have to edit it manually which you can do via below steps:
1. Firstly go into nginx/apache2 directory
Then,
Run command:
~ sudo nano default
configuration file will open in edited mode from which you can edit now
server {
listen 80 default_server;
listen [::]:80 default_server;
location {
proxy_pass http://yourdomain.com:3000;
#try_files comment this line manually via adding #
}
}
Restart your server via nginx/apache2
~ sudo service nginx restart
~ sudo service apache2 restart
That's it now check
http://yourdomain.com this will also work same.
Happy Coding !!
Comments
Post a Comment