Hamburger
goHosting

Install Nginx

Nginx is considered overall more secure and faster for static contents than Apache. Nginx takes up less storage space and consumes less memory. NGINX often do better performance than Apache with many connections on small VPS. Due to its lower resource consumption. You can save money using Nginx IMHO.

Update Debian first

$ sudo apt-get update.

Install the NGINX Open Source package:

$ sudo apt-get install nginx.

Verify the installation:

$ sudo nginx -v nginx version

Add the "default" file using Webmin File Manager:

Default file

Let Nginx know these settings by creating a "symlink".

$ ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default

Add your configuration to "default" file

Edit default

The configuration in "default" file for all websites could look like this

server {
    server_name go4webdev.org www.go4webdev.org;

    location / {
        proxy_pass http://localhost:9090;
    }
}

server {
    server_name static.go4webdev.org;

    location / {
        proxy_pass http://localhost:9091;
    }
}

server {
    server_name table.go4webdev.org;

    location / {
        proxy_pass http://localhost:9092;
    }
}

etc...

You also have to restart the Nginx server to apply the changes. Enter the following command in Webmin terminal to restart the Nginx server. Note that your Go executable may be uploaded first.

Restart Nginx
sudo service nginx restart