diff --git a/.gitmodules b/.gitmodules index 861948a9..9b15e7df 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,3 +5,7 @@ [submodule "app"] path = app url = https://gitea.allosaurus-chromatic.ts.net/tlecommunity/app.git + +[submodule "homepage"] + path = homepage + url = https://gitea.allosaurus-chromatic.ts.net/tlecommunity/homepage.git diff --git a/docker-compose.yml b/docker-compose.yml index b3c985e5..34d89a46 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -117,6 +117,7 @@ services: - ./log/nginx:/etc/nginx/logs - ./captcha:/home/lacuna/server/captcha - ./assets:/home/lacuna/server/var/www/public/assets + - ./homepage:/home/lacuna/server/var/www/public/homepage - ./var/www/public/api/api.css:/home/lacuna/server/var/www/public/api/api.css # TODO: fix CORS etc so that the app can run here properly # - ./app/dist/index.html:/home/lacuna/server/var/www/public/index.html diff --git a/etc-docker/nginx.conf b/etc-docker/nginx.conf index 033fc5cc..adcfd194 100644 --- a/etc-docker/nginx.conf +++ b/etc-docker/nginx.conf @@ -31,11 +31,17 @@ http { add_header Access-Control-Allow-Origin *; } - location = / { + location / { add_header Cache-Control must-revalidate; add_header Cache-Control public; root /home/lacuna/server/var/www/public; - index index.html; + # For debugging: + # add_header X-URI $uri; + try_files $uri + $uri/index.html + /homepage$uri + /homepage$uri/index.html + @backend; } location ~ \.(html|xml|txt|json) { @@ -43,17 +49,33 @@ http { add_header Cache-Control public; root /home/lacuna/server/var/www/public; } + + location = /api { + rewrite ^ /api/ permanent; + } location ^~ /api/ { root /home/lacuna/server/var/www/public; index Intro.html; } + + location = /assets { + rewrite ^ /assets/ permanent; + } location ^~ /assets/ { root /home/lacuna/server/var/www/public; - index README.txt; + index README.txt; # TODO NJR: make a nicer index page than this readme file + } + + location = /app { + rewrite ^ /app/ permanent; } location ^~ /app/ { root /home/lacuna/server/var/www/public; } + + location = /starmap { + rewrite ^ /starmap/ permanent; + } location ^~ /starmap/ { root /home/lacuna/server/var/www/public; index index.html; @@ -69,10 +91,12 @@ http { proxy_set_header X-Forwarded-Host $remote_addr; } - location ~ /.* { + location @backend { proxy_pass http://lacuna-server:5000; proxy_set_header X-Real-IP $remote_addr; - add_header X-Served-By 'Lacuna' always; + # For debugging: + # add_header X-Served-By 'Lacuna' always; + # add_header X-URI $uri always; } } } diff --git a/homepage b/homepage new file mode 160000 index 00000000..fe2207f2 --- /dev/null +++ b/homepage @@ -0,0 +1 @@ +Subproject commit fe2207f2b6bd14909438cfbd50d1b081d2861298 diff --git a/var/www/certs b/var/www/certs deleted file mode 120000 index ef71a329..00000000 --- a/var/www/certs +++ /dev/null @@ -1 +0,0 @@ -/data/Lacuna-Server-Private/var/www/certs \ No newline at end of file diff --git a/var/www/public/index.html b/var/www/public/index.html deleted file mode 100644 index c0ae0436..00000000 --- a/var/www/public/index.html +++ /dev/null @@ -1,6 +0,0 @@ -