From aca29317c6b622aee88658e9931de0c36e6342b9 Mon Sep 17 00:00:00 2001
From: Yasuaki Uechi <y@uechi.io>
Date: Sat, 25 Jun 2022 16:00:17 +0900
Subject: [PATCH] chore: move data path

---
 README.md                     | 1 -
 docker-compose.production.yml | 1 +
 docker-compose.yml            | 2 ++
 nginx.conf                    | 7 ++++++-
 4 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 97b06e0..92d334f 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,6 @@
 ## Build
 
 ```bash
-n 15
 yarn build
 ```
 
diff --git a/docker-compose.production.yml b/docker-compose.production.yml
index f55024b..b66a90c 100644
--- a/docker-compose.production.yml
+++ b/docker-compose.production.yml
@@ -12,6 +12,7 @@ services:
       - "./data:/var/www/html/_:ro"
     labels:
       com.centurylinklabs.watchtower.enable: "true"
+
   cron:
     image: ghcr.io/uetchy/uechi.io
     command: /usr/sbin/crond -d 8 -f
diff --git a/docker-compose.yml b/docker-compose.yml
index d26fcac..f9c18fe 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -6,3 +6,5 @@ services:
     build: .
     ports:
       - "8080:80"
+    volumes:
+      - "./data:/var/www/html/_:ro"
diff --git a/nginx.conf b/nginx.conf
index 89735ba..6cd0225 100644
--- a/nginx.conf
+++ b/nginx.conf
@@ -35,7 +35,7 @@ http {
 
     location / {
       index index.html;
-      try_files $uri $uri.html $uri/index.html =404;
+      try_files $uri $uri.html $uri/index.html @fallback;
     }
 
     location = / {
@@ -43,6 +43,11 @@ http {
         rewrite / /TERMINAL last;
       }
     }
+    
+    location @fallback {
+      root /var/www/html/_;
+      try_files $uri $uri.html $uri/index.html =404;
+    }
   }
 
   server {