I am not using nginx or apache on my application. When I try to get to my domain “mfall33.tk” it “refuses to connect” although I can access my app through my ip address. I think that becase I cant specify my IP Address with my app that the domain can’t access it, is there anyway I could go about specifying it?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Without more information about you application, it’s hard to give you a through answer to your questions. Generally, the port that an application listens on is defined by the application itself in some way. That could be an environmental variable or a run time configuration flag.
Take this simple Express app example:
#!/usr/bin/env node
var debug = require('debug')('my-application');
var app = require('../app');
app.set('port', process.env.PORT || 3000);
var server = app.listen(app.get('port'), function() {
debug('Express server listening on port ' + server.address().port);
});
It defaults to using port 3000 unless the PORT environment variable is set to a different value.
Assuming you have an A record for mfall33.tk pointing to the IP address of your server, to reach the app by visiting the domain it must be listing on port 80 for HTTP or port 443 for HTTPS. This is one of the reasons people put Nginx or Apache in front of their app. The web server can listen to both, redirect one to the other if desired, and proxy the application. So even if you are able to configure the port for your application, it’s still likely worthwhile to put a revers proxy in front of it. Check out this tutorial for an example:
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.