Introduction

In the following article, I described how to set up Archivematica on EC2.

This time, we configure a custom domain and enable HTTPS.

Custom Domain Configuration

This time, we assign the domains matica.aws.ldas.jp and storage.aws.ldas.jp to the IP address. We use Route 53.

Obtaining an SSL Certificate

sudo su
yum install epel-release
yum install certbot
ertbot certonly --webroot -w /usr/share/nginx/html -d matica.aws.ldas.jp -d storage.aws.ldas.jp

Web Server Configuration: Nginx Installation

vi /etc/nginx/conf.d/archivematica-and-storage.conf

Configuration:

server {
  listen 80;
  server_name matica.aws.ldas.jp;

  rewrite ^(.*)$ https://$host$1 permanent;
}

server {
  listen 80;
  server_name storage.aws.ldas.jp;

  rewrite ^(.*)$ https://$host$1 permanent;
}

server {
    listen 443 ssl;
    server_name matica.aws.ldas.jp;

    ssl_certificate /etc/letsencrypt/live/matica.aws.ldas.jp/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/matica.aws.ldas.jp/privkey.pem;

    location / {
        proxy_pass http://localhost:81;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

server {
    listen 443 ssl;
    server_name storage.aws.ldas.jp;

    ssl_certificate /etc/letsencrypt/live/storage.aws.ldas.jp/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/storage.aws.ldas.jp/privkey.pem;

    location / {
        proxy_pass http://localhost:8001;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

As a result, the following URLs became accessible.

ApplicationURL
Archivematicahttps://matica.aws.ldas.jp
Storage Servicehttps://storage.aws.ldas.jp

Summary

I hope this serves as a useful reference for setting up Archivematica.