Webserver Configuration

A simple guide to configure the webserver configuration to allow SSL traffic and ports.

Nginx Webserver Configuration

Nginx Without SSL

Create a configuration file for the app in /etc/nginx/conf.d/. Replace <domain.com> in this example with your app’s domain or public IP address and make sure you use specify the port you used in your settings:

Firstly, we need to go in the correct directory.

cd /etc/nginx/conf.d/

Next, we need to make the configuration file.

touch dashactyl.conf

Now we can edit the file using nano.

apt install nano
nano dashactyl.conf

Paste the text bellow in the file we've just made and change <domain.com> to your domain or IP and change <YourPort> to the port you specified in settings.

server {
  listen 80;
  listen [::]:80;

  server_name <domain.com>;

  location / {
      proxy_pass http://localhost:<YourPort>/;
      proxy_buffering off;
      proxy_set_header X-Real-IP $remote_addr;
  }
}

Nginx With SSL

Enabling the Nginx Configuration

Delete or disable the default config.

sudo mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.disabled

Test your configuration.

sudo nginx -t

If there aren't any errors you can restart the configuration.

sudo nginx -s reload

Last updated

Was this helpful?