Investigation Record of 404 Errors with CloudFront + App Runner

Introduction When trying to host Cantaloupe (an IIIF image server) on AWS App Runner with CloudFront placed in front of it, I encountered a problem where all requests returned 404 errors when accessed through CloudFront. This article records the investigation of the cause, the solutions I tried, and the conclusion. Environment Application: Cantaloupe 5.0.5 (IIIF image server) Hosting: AWS App Runner CDN: Amazon CloudFront Region: ap-northeast-1 (Tokyo) Problem Overview Symptoms Access Method Result Direct access to App Runner 200 OK Access via CloudFront 404 Not Found What Was Confirmed When 404 was returned via CloudFront, the response header contained server: envoy. This indicates that the request was reaching App Runner’s internal proxy (Envoy). ...

December 24, 2025 · 8 min · Nakamura

Using Route 53 DNS Records with Sakura Rental Server (Shared SSL)

Overview This is a memo on using DNS records configured in AWS Route 53 with Sakura Rental Server. Additionally, we use free SSL with Let’s Encrypt. Sakura Rental Server Go to Domain/SSL and click the “Add New Domain” button. Click the “Add” button under “Use a domain acquired from another provider without transferring” at the bottom of the screen. Enter the custom domain and click the “Add” button. In the following example, “aaa.example.org” is used. ...

March 18, 2025 · 1 min · Nakamura

Adding a Table of Contents to Videos Using iiif-prezi3

Overview This is a memo on how to add a table of contents to videos using iiif-prezi3. Segment Detection We use Amazon Rekognition’s video segment detection. https://docs.aws.amazon.com/ja_jp/rekognition/latest/dg/segments.html Sample code is available at the following link. https://docs.aws.amazon.com/ja_jp/rekognition/latest/dg/segment-example.html Data Used We use “Prefectural News Volume 1” (Nagano Prefectural Library). https://www.ro-da.jp/shinshu-dcommons/library/02FT0102974177 Reflecting in the Manifest File We assume that a manifest file has already been created by referring to the following article. The following script adds a VTT file to the manifest file. ...

October 9, 2024 · 13 min · Nakamura

Adding Annotations to Videos Using iiif-prezi3

Overview This is a note on how to add annotations to videos using iiif-prezi3. Adding Annotations Amazon Rekognition’s label detection is used. https://docs.aws.amazon.com/rekognition/latest/dg/labels.html?pg=ln&sec=ft Sample code is available at the following link. https://docs.aws.amazon.com/ja_jp/rekognition/latest/dg/labels-detecting-labels-video.html In particular, by setting the aggregation in GetLabelDetection to SEGMENTS, you can obtain StartTimestampMillis and EndTimestampMillis. However, please note the following. When aggregated by SEGMENTS, information about detected instances with bounding boxes is not returned. Data Used The video “Prefectural News Vol. 1” (Nagano Prefectural Library) is used. ...

October 9, 2024 · 17 min · Nakamura

[2024 Edition] Building an IIIF Image Server with AWS Serverless Applications

Overview This is a 2024 edition article on building an IIIF Image Server using AWS serverless applications. Background The following repository called serverless-iiif is publicly available. Using this repository, it is claimed that a cost-effective and infinitely scalable IIIF Image Server can be built using AWS services. https://github.com/samvera/serverless-iiif I introduced how to use it as of 2022 in the following article, but today’s service has become more user-friendly. Method There are several build methods, but for a GUI-based approach, refer to the following. Basic setup follows the instructions on the site below. Here, I introduce the procedure including custom domain setup with CloudFront and Route 53. ...

September 9, 2024 · 3 min · Nakamura

Using mdx Object Storage (Using Cyberduck)

Overview I had the opportunity to use mdx’s object storage, so this is a memo. https://mdx.jp/ Pricing The pricing for fiscal year 2024 is as follows. https://mdx.jp/guide/charge It costs 0.01 points (yen) per GB per day, which is approximately 0.3 yen per GB per month. Application Method & Usage with s3cmd The following official tutorial video was helpful. https://www.youtube.com/watch?v=IN_4NS9hO2Y Using Cyberduck The video above introduces file operations using command-line tools. ...

July 6, 2024 · 2 min · Nakamura

Redirecting Using Amazon S3 and Route 53

Overview I needed to redirect from one URL to another and was able to accomplish this using Amazon S3 and Route 53, so this is a memo of the process. Method This method uses an S3 bucket for the redirect and Route 53 for DNS configuration. The steps are explained below. Step 1: Amazon S3 Bucket Configuration Create a new bucket in Amazon S3. The bucket name should match the domain name you want to redirect (e.g., example.com). In the bucket properties, select “Static website hosting.” In the “Static website hosting” options, choose “Redirect requests” and enter the redirect destination URL (e.g., http://example.net). Step 2: DNS Configuration in Route 53 In Route 53, open the hosted zone for the domain name you want to redirect. Create a new record set. Select A as the record type. Set “Alias” to “Yes.” As the alias target, select the static website hosting endpoint of the S3 bucket configured in Step 1 (e.g., example.com.s3-website-us-east-1.amazonaws.com). With this setup, when someone accesses the specified domain, they will be redirected to the configured URL. This method is simple yet effective for redirecting from one domain to another URL. ...

July 3, 2024 · 1 min · Nakamura

How to Handle CSP Errors in Strapi

Overview I configured Strapi with the following plugin to store media in S3. https://www.npmjs.com/package/@liashchynskyi/strapi-provider-upload-s3-cloudfront At that time, the following error occurred and images were not displayed. R e f u s e d t o l o a d t h e i m a g e ' h t t p s : / / x x x / u p l o a d s / y y y . j p g ' b e c a u s e i t v i o l a t e s t h e f o l l o w i n g C o n t e n t S e c u r i t y P o l i c y d i r e c t i v e : " i m g - s r c ' s e l f ' d a t a : b l o b : d l . a i r t a b l e . c o m " . I was able to resolve this issue by modifying ./config/middleware.js, as described in the following article. ...

June 12, 2024 · 2 min · Nakamura

Bulk Deleting S3 Buckets Using AWS CLI

To list S3 buckets using AWS CLI and delete buckets based on a specific pattern, you can follow the steps below. Here, we explain how to delete buckets whose names start with wby. Prerequisites AWS CLI is installed. Appropriate AWS credentials and access permissions are configured. Step 1: List Buckets First, use the installed AWS CLI to list all S3 buckets: a w s s 3 l s Step 2: Delete Matching Buckets To delete buckets starting with wby, use a shell script to filter matching buckets and delete them. ...

April 26, 2024 · 2 min · Nakamura

Configuring Amazon S3 as a Processing Source and AIP Storage Destination in Archivematica

Overview This is a memo on how to configure Amazon S3 files and folders as processing targets in Archivematica, and save the resulting AIPs to S3. Using S3 as storage is expected to facilitate integration with other systems and expand options for long-term AIP preservation. The following article from Wellcome Collection was helpful. https://docs.wellcomecollection.org/archivematica/administering-archivematica/bootstrapping Amazon S3 Configuration Create a bucket. This time, I created a bucket named archivematica.aws.ldas.jp in the us-east-1 region. ...

February 3, 2024 · 3 min · Nakamura

How to Access S3 Buckets and Enable SSL Communication Using Docker-based Cantaloupe

Overview I introduced how to use the Docker version of Cantaloupe in the following article. To use this Docker-based Cantaloupe in a (non-large-scale) production environment, connection to Amazon S3 and SSL support are required. Here is an example of how to do this. Connecting to Amazon S3 The official documentation is available at: https://cantaloupe-project.github.io/manual/5.0/sources.html#S3Source The following Japanese article is also available: For the Docker version covered here, information was found at: ...

January 27, 2024 · 8 min · Nakamura

Sending Emails via Amazon SES from Omeka S on Amazon Lightsail

Overview To send emails from Omeka S running on Amazon Lightsail, it appears that email sending configuration is required. This article introduces how to use Amazon SES. https://aws.amazon.com/jp/ses/ The following forum discussion was helpful. https://forum.omeka.org/t/configuring-sendmail-or-smtp-for-omeka-s-on-amazon-lightsail/19335/1 Amazon SES Configuration Configure Amazon SES by referring to the following site. https://qiita.com/Shun_konno/items/f51ae599b68e0d2d36ea Omeka S Configuration Edit the Omeka S local.config.php file as follows. < r ] ? e ; p t h u p r ' ] ' ] n l , m , o a ' [ g i u O g l ' s ] t e ' t e , h r r _ e ' L = a c r o > n ' o ] = g s t o m , s > [ p y p p e s o p t l t [ e r e i ' ' ' ' ' e ] t t t ' o n h p c c t , i t ' n a o o o o e n i = s m s r n n _ g n = > ' e t t n n ' ' ' q s g > ' ' ' e e u p s u . s ' = c c s a s i . [ s > = = = t t e s l t . ( m > > > i i r s ' ' a t [ o o n w s p ' ' 5 n n a o = ' s e 8 _ _ m r > n , e m 7 c c e d e s a , l o ' ' t e - i a n r d s l s f = = = u e m - s i > > > e d U t s ' g , ) s p m ' ' ' ' e - t y y t u p = = o o l S s . > > u u s M e u r r ' T r s ' [ - - , P ' - p s s , e l e e a a s s s i - - t n s s - ' m m 1 , t t . p p a - - m u p a s a z e s o r s n n w A a a o n w m r y s e d . ' ' n c , , a o m m e ' , S S S P A E E S o u S S L S r t E t h S S t S e M M y s n T T p S u t P P e M p i T p c u p P o a s a ' r t e s t s t i r s l e e o n w s r d n a o ' v m r e b t e d r r y y e p c e S e o n E m d S m p e o ( n i e d n . e t g d . ) , 5 8 7 ) For host, specify the Amazon SES SMTP server endpoint corresponding to the AWS region you are using. The example uses the us-east-1 region endpoint, but change it as needed. For username and password, use the SMTP credentials generated in Amazon SES. Summary We hope this is helpful when using Omeka S with Amazon Lightsail. ...

January 13, 2024 · 3 min · Nakamura

Restarting Virtuoso on EC2 Using Amazon SNS

Overview In the following article, I described how to perform health checks. I also described the command for restarting Virtuoso when it stops in the following article. This time, I will try restarting Virtuoso in conjunction with Amazon SNS notifications. Method To send a command like sudo rm -rf /usr/local/var/lib/virtuoso/db/virtuoso.lck && ... to an EC2 instance, SSM (AWS Systems Manager) configuration was required. IAM Roles and Policies I created a new IAM role and granted the AmazonSSMFullAccess policy. Initially, I had granted the AmazonSSMManagedInstanceCore policy, but the following error occurred when executing the Lambda function described later, and it did not work properly. ...

November 24, 2023 · 13 min · Nakamura

Resolving SAM Error: Running AWS SAM Projects Locally Requires Docker

Overview When trying sam local invoke with AWS SAM, the following message was displayed. E r r o r : R u n n i n g A W S S A M p r o j e c t s l o c a l l y r e q u i r e s D o c k e r . H a v e y o u g o t i t i n s t a l l e d a n d r u n n i n g ? The environment was Mac, and Docker was running. ...

November 24, 2023 · 1 min · Nakamura

Cantaloupe: Serving Images Stored in Amazon S3

Overview This is a note on how to serve images stored in Amazon S3 using Cantaloupe Image Server, one of the IIIF image servers. As an alternative method for serving images stored in Amazon S3, I also introduced an approach in the following article. (The tools may have been updated since the article was written, so the instructions may not work exactly as described.) Configuration The official manual is available at the following link. ...

November 16, 2023 · 7 min · Nakamura

Disabling Autotune in Amazon OpenSearch Service

When attempting to change the instance type from t3.small.search to t3.medium.search on a development domain in Amazon OpenSearch Service, the following message was displayed. A u t o t u n e i s n o t s u p p o r t e d i n t 2 / t 3 i n s t a n c e t y p e s . D i s a b l e a u t o t u n e o r c h a n g e y o u r i n s t a n c e t y p e . I could not find the Autotune setting in the UI, but the following page described how to do it using the CLI. ...

October 3, 2023 · 2 min · Nakamura

Enabling HTTPS for Archivematica on EC2

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 s y y e u u u r d m m t o b i i o s n n t u s s t t c a a e l l r l l t o e c n p e l e r y l t - b r o - e t w l e e b a r s o e o t - w / u s r / s h a r e / n g i n x / h t m l - d m a t i c a . a w s . l d a s . j p - d s t o r a g e . a w s . l d a s . j p Web Server Configuration: Nginx Installation v i / e t c / n g i n x / c o n f . d / a r c h i v e m a t i c a - a n d - s t o r a g e . c o n f Configuration: ...

September 22, 2023 · 6 min · Nakamura

Launching Cantaloupe, a IIIF Image Server, on EC2

Overview This is a personal note on how to launch Cantaloupe, a IIIF image server, on EC2. https://cantaloupe-project.github.io/ Additionally, I introduce an example of using Delegate Methods to add restrictions on image download size. Specifically, I address cases where an error occurs when trying to retrieve full-size images using /full/full/. https://cantaloupe-project.github.io/manual/5.0/access-control.html Setting Up Cantaloupe Creating an EC2 Instance I created an EC2 instance with the platform set to Ubuntu, instance type set to t2.medium, and storage set to 8GB. ...

September 19, 2023 · 13 min · Nakamura

Accessing a Specific AWS S3 Bucket Using Cyberduck for macOS

I tried to access a specific AWS S3 bucket using Cyberduck, referencing the following article. https://dev.classmethod.jp/articles/specify_s3_folder_iam_cyberduck/ However, when I opened the macOS version of Cyberduck and pressed the “New Connection” button at the top of the screen, the form for entering bucket information and other details was not displayed. After investigating, I found the following issue. https://github.com/iterate-ch/cyberduck/issues/11154 It indicated that you should open a bookmark instead, as follows: Please refer to Access third party buckets. To set a default path, create a new bookmark instead of choosing Open Connectoin. ...

August 16, 2023 · 1 min · Nakamura

Health Checking Virtuoso Running on Amazon EC2

Overview I had the opportunity to set up health checks for Virtuoso running on Amazon EC2, so this is a memo of the process. Specifically, when Virtuoso (e.g., https://xxx.zzz/sparql) starts returning errors due to some issue, the details are sent via email notification. Method The following article introduces how to set up a Virtuoso RDF store on Amazon EC2. The above setup uses an ELB. Only one change needs to be made from the above article. The Health check path was set to /, but this should be changed to the path to the SPARQL endpoint (e.g., /sparql). ...

July 14, 2023 · 7 min · Nakamura