<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.itcollege.ee/index.php?action=history&amp;feed=atom&amp;title=User_talk%3AFislam</id>
	<title>User talk:Fislam - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.itcollege.ee/index.php?action=history&amp;feed=atom&amp;title=User_talk%3AFislam"/>
	<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=User_talk:Fislam&amp;action=history"/>
	<updated>2026-05-11T06:24:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=User_talk:Fislam&amp;diff=128794&amp;oldid=prev</id>
		<title>Fislam: Created page with &quot;== Installation ==  ===Preparing=== Some necessary packages that must be installed prior to beginning with the actual gogs installation. First of all do a  &lt;code&gt;sudo apt-get...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=User_talk:Fislam&amp;diff=128794&amp;oldid=prev"/>
		<updated>2017-12-22T12:37:58Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Installation ==  ===Preparing=== Some necessary packages that must be installed prior to beginning with the actual gogs installation. First of all do a  &amp;lt;code&amp;gt;sudo apt-get...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Installation ==&lt;br /&gt;
&lt;br /&gt;
===Preparing===&lt;br /&gt;
Some necessary packages that must be installed prior to beginning with the actual gogs installation.&lt;br /&gt;
First of all do a &lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get update&amp;lt;/code&amp;gt;&lt;br /&gt;
Install the following packages (some are for later)&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install -y gcc g++ build-essential dpkg mysql-server wget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the installation, you will be asked to enter the password of the database root user. Make sure you use a secure one, and remember it, because you&amp;#039;ll need it later in this tutorial.Now create and open a file named gogs.sql. Here, we&amp;#039;re using nano, but you can use your favorite text editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;nano gogs.sql&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this in the newly created sql dump&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DROP DATABASE IF EXISTS gogs;&lt;br /&gt;
CREATE DATABASE IF NOT EXISTS gogs CHARACTER SET utf8 COLLATE utf8_general_ci;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, execute gogs.sql with MySQL to create the Gogs database. Replace your_password with the root password you chose earlier in this step.&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -pyour_password &amp;lt; gogs.sql &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To install Gogs from source, version control tools like Git and Mercurial are needed, so install them next.&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get -y install mercurial git&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Installing Go===&lt;br /&gt;
&lt;br /&gt;
It is recoomended to add a new user git before installing go. Root permissions are not required for this user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;adduser git&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because Gogs is written in Go, we need to install it before compiling Gogs.&lt;br /&gt;
&lt;br /&gt;
First, there are some environment variables we need to set for Go. To do that, open the file ~/.bashrc for editing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;nano ~/.bashrc&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the following lines to the end of the file, then close and save it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export GOPATH=/home/git/go&lt;br /&gt;
&lt;br /&gt;
export GOROOT=/usr/local/src/go&lt;br /&gt;
&lt;br /&gt;
export PATH=${PATH}:$GOROOT/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, apply your changes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source ~/.bashrc&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now get the most recent compiled version of go from their website &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;wget https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Decompress&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;tar zxf go1.4.2.linux-amd64.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change directories to the $GOROOT we defined in ~/.bashrc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo mv go $GOROOT&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now test if Go is working.&lt;br /&gt;
&lt;br /&gt;
===Installing Gogs===&lt;br /&gt;
&lt;br /&gt;
Go has a built in command, get, for easily downloading the source code of a Go project along with all of its dependencies, which we&amp;#039;ll use to download Gogs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;go get -d github.com/gogits/gogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source code of Gogs will now be in $GOPATH/src/github.com/gogits/gogs, so move there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $GOPATH/src/github.com/gogits/gogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, build and generate the binary. This command may take a moment to run.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;go build&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now test go by moving into go directory and typing &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;./go&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should run Go. However, to run it on the the background.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;./go &amp;amp;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using Supervisor to manage Go===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get -y install supervisor&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s make a Gogs daemon by creating a Supervisor configuration section. First, create a directory for the log files to live in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo mkdir -p /var/log/gogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo nano /etc/supervisor/supervisord.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Append the following contents to the file to create the Gogs section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
[program:gogs]&lt;br /&gt;
&lt;br /&gt;
directory=/home/git/go/src/github.com/gogits/gogs/&lt;br /&gt;
&lt;br /&gt;
command=/home/git/go/src/github.com/gogits/gogs/gogs web&lt;br /&gt;
&lt;br /&gt;
autostart=true&lt;br /&gt;
&lt;br /&gt;
autorestart=true&lt;br /&gt;
&lt;br /&gt;
startsecs=10&lt;br /&gt;
&lt;br /&gt;
stdout_logfile=/var/log/gogs/stdout.log&lt;br /&gt;
&lt;br /&gt;
stdout_logfile_maxbytes=1MB&lt;br /&gt;
&lt;br /&gt;
stdout_logfile_backups=10&lt;br /&gt;
&lt;br /&gt;
stdout_capture_maxbytes=1MB&lt;br /&gt;
&lt;br /&gt;
stderr_logfile=/var/log/gogs/stderr.log&lt;br /&gt;
&lt;br /&gt;
stderr_logfile_maxbytes=1MB&lt;br /&gt;
&lt;br /&gt;
stderr_logfile_backups=10&lt;br /&gt;
&lt;br /&gt;
stderr_capture_maxbytes=1MB&lt;br /&gt;
&lt;br /&gt;
environment = HOME=&amp;quot;/home/git&amp;quot;, USER=&amp;quot;git&amp;quot;&lt;br /&gt;
&lt;br /&gt;
user = git&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This section defines the command we want to execute to start Gogs, automatically starts it with Supervisor, and specifies the locations of log files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo service supervisor restart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can check that Gogs is running with the following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ps -ef | grep gogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can verify that the server is running by taking a look at the stdout.log file, too.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;tail /var/log/gogs/stdout.log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Output should look like &amp;lt;code&amp;gt;2017/12/31 14:24:42 [I] Gogs: Go Git Service 0.5.16.0301 Beta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Deploying==&lt;br /&gt;
&lt;br /&gt;
===Set up nginx as reverse proxy===&lt;br /&gt;
You should also be able visit the web page with URL http://your_server_ip:3000/. This will redirect to the installation page, but don&amp;#039;t fill that out just yet. But we want it running on port 80 for now.&lt;br /&gt;
&lt;br /&gt;
Install nginx&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get -y install nginx&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a config file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo nano /etc/nginx/sites-available/servername&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adjust to the following template&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;server {&amp;lt;/code&amp;gt;&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name your_server_ip;&lt;br /&gt;
&lt;br /&gt;
    proxy_set_header X-Real-IP  $remote_addr; # pass on real client IP&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://localhost:3000;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And symlink it so that Nginx can use it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo ln -s /etc/nginx/sites-available/gogs /etc/nginx/sites-enabled/gogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more about Nginx virtual host configuration files, see this tutorial.&lt;br /&gt;
&lt;br /&gt;
Finally, restart Nginx to activate the virtual host configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo service nginx restart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able visit the web page with the URL http://your_server_ip/, without specifying the port.&lt;br /&gt;
&lt;br /&gt;
===Initialize Gogs===&lt;br /&gt;
There is one more simple step left to initialize Gogs for its first run.&lt;br /&gt;
&lt;br /&gt;
Visit http://your_server_ip/install and fill in the following options. Many of them will be filled out for you already, but make sure to replace the variables in red with the values for your server.&lt;br /&gt;
&lt;br /&gt;
In the first section, Gogs requires MySQL, PostgreSQL or SQLite3, fill out:&lt;br /&gt;
&lt;br /&gt;
Database Type: MySQL&lt;br /&gt;
Host: 127.0.0.1:3306&lt;br /&gt;
User: root&lt;br /&gt;
Password: your_database_password&lt;br /&gt;
Database Name: gogs&lt;br /&gt;
In the second section, General Settings of Gogs, fill out:&lt;br /&gt;
&lt;br /&gt;
Repository Root Path: /home/git/gogs-repositories&lt;br /&gt;
Run User: git&lt;br /&gt;
Domain: your_server_ip&lt;br /&gt;
HTTP Port: 3000&lt;br /&gt;
Application URL: http://your_server_ip/&lt;br /&gt;
Skip the optional e-mail and notification settings, then under Admin Account Settings, choose an admin username and password, and include your email address. We&amp;#039;ll refer to the admin username as your_admin_username in the next step.&lt;br /&gt;
&lt;br /&gt;
Finally, click Install Gogs, and then log in.&lt;br /&gt;
&lt;br /&gt;
===Test Gogs===&lt;br /&gt;
&lt;br /&gt;
First, go to http://your_server_ip/repo/create and create a repository with the name my-test-repo, and you click on the option Initialize this repository with a README.md.&lt;br /&gt;
&lt;br /&gt;
Now you should be able to clone it. First, move to your home directory.&lt;br /&gt;
&lt;br /&gt;
cd&lt;br /&gt;
Next, clone the repository.&lt;br /&gt;
&lt;br /&gt;
git clone http://your_server_ip/your_admin_username/my-test-repo.git&lt;br /&gt;
Change to the repository directory.&lt;br /&gt;
&lt;br /&gt;
cd my-test-repo&lt;br /&gt;
Update the README.md.&lt;br /&gt;
&lt;br /&gt;
echo &amp;#039;Blaaa blaaa World&amp;#039; &amp;gt;&amp;gt; README.md&lt;br /&gt;
Commit your changes and push them. This command will ask you for your Gogs username and password.&lt;br /&gt;
&lt;br /&gt;
git add --all &amp;amp;&amp;amp; git commit -m &amp;quot;init commit&amp;quot; &amp;amp;&amp;amp; git push origin master&lt;br /&gt;
&lt;br /&gt;
==Securing gogs==&lt;br /&gt;
We need to install Let&amp;#039;s Encrypt, generate CA certificate and use nginx to redirect HTTP traffic to HTTPS.&lt;br /&gt;
&lt;br /&gt;
First, add the repository.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo add-apt-repository ppa:certbot/certbot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&amp;#039;ll need to press ENTER to accept. Then, update the package list to pick up the new repository&amp;#039;s package information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get update&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install python-certbot-nginx&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configure Iptables===&lt;br /&gt;
Before starting with the certificate, Iptables should be configured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt install iptables iptables-persistent&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you can use the following iptables rules&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-P INPUT DROP&lt;br /&gt;
&lt;br /&gt;
-P FORWARD DROP&lt;br /&gt;
&lt;br /&gt;
-P OUTPUT ACCEPT&lt;br /&gt;
&lt;br /&gt;
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
-A INPUT -s 127.0.0.0/8 -i lo -m comment --comment &amp;quot;Allow loopback&amp;quot; -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
-A INPUT -i eth1 -m comment --comment &amp;quot;Allow traffic from LAN&amp;quot; -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
-A INPUT -p icmp -m icmp --icmp-type 8 -m comment --comment &amp;quot;Allow ping&amp;quot; -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the rules persistent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo invoke-rc.d iptables-persistent save &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
View Iptables status &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;iptables -L&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Obtain SSL Certiciate===&lt;br /&gt;
Install CertBot &amp;amp; Let&amp;#039;s Encrypt&lt;br /&gt;
Add the repository&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo add-apt-repository ppa:certbot/certbot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install python-certbot-apache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo certbot --nginx -d example.com -d www.example.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This runs certbot with the --nginx plugin, using -d to specify the names we&amp;#039;d like the certificate to be valid for.&lt;br /&gt;
&lt;br /&gt;
If this is your first time running certbot, you will be prompted to enter an email address and agree to the terms of service. After doing so, certbot will communicate with the Let&amp;#039;s Encrypt server, then run a challenge to verify that you control the domain you&amp;#039;re requesting a certificate for.&lt;br /&gt;
&lt;br /&gt;
If that&amp;#039;s successful, certbot will ask how you&amp;#039;d like to configure your HTTPS settings. For the moment do not select any redirection. Keep using http.&lt;br /&gt;
&lt;br /&gt;
===Self-signed cert (If you do not use Let&amp;#039;s Encrypt===&lt;br /&gt;
In case of a self signed certificate&lt;br /&gt;
&amp;lt;code&amp;gt;sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Generate DHParam and strengthen nginx===&lt;br /&gt;
&lt;br /&gt;
While we are using OpenSSL, we should also create a strong Diffie-Hellman group, which is used in negotiating Perfect Forward Secrecy with clients.&lt;br /&gt;
&lt;br /&gt;
We can do this by typing:&lt;br /&gt;
&lt;br /&gt;
sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048&lt;br /&gt;
&lt;br /&gt;
Create a Configuration Snippet with Strong Encryption Settings&lt;br /&gt;
&lt;br /&gt;
Next, we will create another snippet that will define some SSL settings. This will set Nginx up with a strong SSL cipher suite and enable some advanced features that will help keep our server secure.&lt;br /&gt;
&lt;br /&gt;
The parameters we will set can be reused in future Nginx configurations, so we will give the file a generic name:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo nano /etc/nginx/snippets/ssl-params.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
# from https://cipherli.st/&lt;br /&gt;
# and https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html&lt;br /&gt;
&lt;br /&gt;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;&lt;br /&gt;
&lt;br /&gt;
ssl_prefer_server_ciphers on;&lt;br /&gt;
&lt;br /&gt;
ssl_ciphers &amp;quot;EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
ssl_ecdh_curve secp384r1;&lt;br /&gt;
&lt;br /&gt;
ssl_session_cache shared:SSL:10m;&lt;br /&gt;
&lt;br /&gt;
ssl_session_tickets off;&lt;br /&gt;
&lt;br /&gt;
ssl_stapling on;&lt;br /&gt;
&lt;br /&gt;
ssl_stapling_verify on;&lt;br /&gt;
&lt;br /&gt;
resolver 8.8.8.8 8.8.4.4 valid=300s;&lt;br /&gt;
&lt;br /&gt;
resolver_timeout 5s;&lt;br /&gt;
&lt;br /&gt;
# Disable preloading HSTS for now.  You can use the commented out header line that includes&lt;br /&gt;
&lt;br /&gt;
# the &amp;quot;preload&amp;quot; directive if you understand the implications.&lt;br /&gt;
&lt;br /&gt;
#add_header Strict-Transport-Security &amp;quot;max-age=63072000; includeSubdomains; preload&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
add_header Strict-Transport-Security &amp;quot;max-age=63072000; includeSubdomains&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
add_header X-Frame-Options DENY;&lt;br /&gt;
&lt;br /&gt;
add_header X-Content-Type-Options nosniff;&lt;br /&gt;
&lt;br /&gt;
ssl_dhparam /etc/ssl/certs/dhparam.pem;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reconfigure nginx for https redirection===&lt;br /&gt;
Fairly straightforward process assuming your servername is servername.eu. Open up the &amp;lt;code&amp;gt;nano /etc/nginx/sites-available/servername&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the configuration file should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;server {&lt;br /&gt;
        server_name servername.eu;&lt;br /&gt;
        listen 443 ssl; # managed by Certbot&lt;br /&gt;
        ssl_certificate /etc/letsencrypt/live/servername.eu/full.pem# managed by Certbot&lt;br /&gt;
        ssl_certificate_key /etc/letsencrypt/live/servername.eu/privkey.pem; # managed by Certbot&lt;br /&gt;
        include snippets/ssl-params.conf;&lt;br /&gt;
        proxy_set_header X-Real-IP  $remote_addr; # pass on real client IP&amp;lt;/code&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        location / {&lt;br /&gt;
        proxy_pass http://localhost:3000;}}&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
server{&amp;lt;/code&amp;gt;&lt;br /&gt;
        server_name servername.eu&lt;br /&gt;
        listen 80;&lt;br /&gt;
        return 301 https://servername.eu;}&lt;/div&gt;</summary>
		<author><name>Fislam</name></author>
	</entry>
</feed>