By Jay Bennett
I’m new to this. A friend and I have been trying to set up a MUD game we’re building. I’ve managed to get it installed in my Droplet, and I’ve purchased a custom domain for the game to be played from. My problem is in configuring my droplet in a way that it will a) run the app (evennia start from the project’s main directory) and b) allow for connection to the app through my custom domain. Any help at all would be greatly appreciated.
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!
Accepted Answer
Heya @jaycb3,
First, you’ll need to configure Nginx and make it work as a reverse proxy.
If you haven’t already installed Nginx, you can do so using your system’s package manager. For most Linux distributions, the command is:
sudo apt update
sudo apt install nginx
sudo yum install epel-release
sudo yum install nginx
/etc/nginx/sites-available/
directory (you can name the file after your domain for clarity, like doomain.com.conf
):sudo nano /etc/nginx/sites-available/doomain.com.conf
where doomain.com
would be the real domain that you have purchased.
sudo nano /etc/nginx/sites-available/doomain.com.conf
Add the following configuration to the file. This configuration tells Nginx to listen on the default HTTP port (80) and proxy the requests to your application running on localhost, port 3000:
server {
listen 80;
server_name example.com; # Replace with your domain name or IP address
location / {
proxy_pass http://localhost:3000; # Proxy pass to the app on port 3000
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Since I do not know on which port your application runs, I’ve set it to 3000 however you can set it to any port you wish.
Replace example.com
with your domain name or IP address.
Symlink this file to the /etc/nginx/sites-enabled/
directory to enable it:
sudo ln -s /etc/nginx/sites-available/doomain.com.conf /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
If you have a firewall running, such as ufw
, you need to allow HTTP traffic:
sudo ufw allow 'Nginx Full'
You should now be able to access your application via your server’s domain name or IP address (on port 80) in a web browser.
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.