Make your Alfresco more secure

Alfresco 5.2 + Nginx + SSL using Certbot

Sergey Palyukh
17. Dec ‘18


It is step by step instruction how to set up Nginx proxy server over the Alfresco and configure SSL encoding of your requests. For this example, we are using Ubuntu 16.04 and Certbot as a provider of authorised certificates for free.
  • You have to add DNS record to map hostname to the IP of the server.
  • Open ports 80 and 443 for the public access in your firewall 
  1. Install Alfresco in any comfortable way:
    • using Alfresco installer
    • manually by deploying WAR files to a servlet container like Tomcat
    • using Doker
  2. Install Nginx
    $ sudo apt-get install nginx
  3. Configure Nginx to proxy requests to Alfresco
    • Create the config file
      $ sudo vi /etc/nginx/sites-available/alfresco.conf
    • Put the following content into the config file
      server {
          listen  80;
          proxy_redirect	off;
          proxy_buffering	off;
          proxy_set_header        X-Real-IP       $remote_addr;
          proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header        host    $host;
          proxy_set_header        X-Forwarded-Server      $host;
          client_max_body_size	1G;
          location / {
              rewrite ^/$ /share;
          location /share {
          location /alfresco {

      Override value of the server_name property to yours and check the proxy_pass values, they should be connected to https protocol and appropriate port, by default https port for Alfresco installation is 8443

    • Save changes and close (:x command in vi editor)
    • Enable Nginx config
      $ sudo ln -s /etc/nginx/sites-available/alfresco.conf /etc/nginx/sites-enabled
    • Restart Nginx
      $ sudo systemctl restart nginx
  4. Install Certbot
    $ sudo apt-get update
    $ sudo apt-get install software-properties-common
    $ sudo add-apt-repository universe
    $ sudo add-apt-repository ppa:certbot/certbot
    $ sudo apt-get update
    $ sudo apt-get install python-certbot-nginx
  5. Generate SSL certificate and apply
    $ sudo certbot --nginx

That’s all. Currently, your Alfresco server is behind the Nginx proxy server and all requests will go through the SSL. You can test your configuration at ssllabs website (see the arrow at the image above).