No internet connection
  1. Home
  2. Documentation

Talkyard with Nginx as reverse proxy and Letsencrypt for https [Mini tutorial]

By @Locatelli2020-05-18 06:17:49.259Z2020-05-19 15:04:25.711Z


I finally made work my Talkyard instance with nginx as reverse proxy and letsencrypt for ssl, and it took me several hours so I thought I might leave this over here so others can do it in just minutes.

Environment is a VPS with Ubuntu 18.04.

1.. Follow the Talkyard official Install instructions at UP TO STEP 6 ONLY.

2.. Now In the file /opt/talkyard/docker-compose.yml you must change this:

  - '80:80'
  - '443:443'

to this:

  - '8080:80'
  - '8443:443'

Or the port or number of your choice if you know what you are doing.

3.. Setup Talkyard to be able to work with https/ssl. If you don't do this it won't work:

sudo nano /opt/talkyard/conf/play-framework.conf 

now find:

and change it to:

4.. Now resume the official instructions at from step 7 onwards . IMPORTANT: Ignore the HTTPS instructions present at that other doc at They are confusing and don't work for what we want to do.

5.. Install nginx in your server:

sudo apt install nginx

6.. Create a new server block.

sudo nano /etc/nginx/sites-available/

That file will be empty. Now fill it with the following (of course you need to replace with your actual subdomain. Remember talkyard only accepts subdomains):

server {
    listen 80;
    location /.well-known {
            alias /var/www/;
    location / {
        # proxy commands go here

Save the file to /etc/nginx/sites-available/ and close the editor.

7.. Now follow the instructions in this post "LetsEncrypt with an nginx reverse proxy" in order to configure the nginx server block, get the Letsencypt certificate, and optionally set up automatic redirection to HTTPS.

8.. Now add the talkyard configuracion to the SSL part of your server block:

server {
  listen 443 ssl;
  listen [::]:443 ssl;


  # SSL config ...

  # Reverse proxy to Talkyard:
  location / {
    proxy_http_version 1.1;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_read_timeout 120;

Edit with your domain name. Now test nginx

sudo nginx -t

If there are problems, check for typos, etc. If everything is ok, enable the site:

sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/

Now reload nginx

sudo systemctl reload nginx

If everything was ok, and you have have properly configured your domain at the DNS (which is outside the scope of this tutorial), then you should be able to see Talkyard working at

I hope this was helpful.

  • 1 replies
  1. KajMagnus @KajMagnus2020-05-19 15:04:01.300Z

    Hi Locatelli, thanks for writing this — I now linked to this mini tutorial from the GitHub readme: (and moved this topic to the Documentation category).

    @ others: That whole answer over at ServerFault, i.e.: "LetsEncrypt with an nginx reverse proxy", is good to read all of it