Compare commits

..

4 Commits

Author SHA1 Message Date
6563cfc7e6 add optional redirection 2023-03-16 11:48:17 +13:00
3wc
bb9945b38d Switch to self-hosted stack-ssh-deploy image [mass update] 2023-01-21 11:49:55 -08:00
3wc
c50f5397bf Update abra syntax in examples (finally) [mass update] 2023-01-19 16:02:27 -08:00
3wc
2a3021744d Further Drone fix 2023-01-19 15:53:48 -08:00
6 changed files with 31 additions and 8 deletions

View File

@ -3,7 +3,7 @@ kind: pipeline
name: deploy to swarm-test.autonomic.zone
steps:
- name: deployment
image: decentral1se/stack-ssh-deploy:latest
image: git.coopcloud.tech/coop-cloud/stack-ssh-deploy:latest
settings:
host: swarm-test.autonomic.zone
stack: custom_html
@ -16,6 +16,8 @@ steps:
DOMAIN: custom-html.swarm-test.autonomic.zone
STACK_NAME: custom_html
LETS_ENCRYPT_ENV: production
NGINX_DEFAULT_CONF_VERSION: v1
ENTRYPOINT_CONF_VERSION: v1
trigger:
branch:
- main

View File

@ -14,3 +14,12 @@ COMPOSE_FILE="compose.yml"
#COMPOSE_FILE="$COMPOSE_FILE:compose.git-pull.yml"
#GIT_REPO_URL="https://git.coopcloud.tech/dalmationer/hexbomb.gay"
#CRON_SCHEDULE="*/1 * * * *"
# Optionally redirect the entire domain or a sub-path:
# path under which you want to redirect all URLs (with trailing slash):
#REDIRECT_FROM_PATH=/
# full URL of target domain (and optionally path) with trailing slash:
#REDIRECT_TO_URL=https://coopcloud.tech/
# temporary or permanent redirect? (uncomment one)
#REDIRECT_TYPE=redirect
#REDIRECT_TYPE=permanent

View File

@ -20,9 +20,9 @@ Custom HTML website, served using Nginx.
1. Set up Docker Swarm and [`abra`]
2. Deploy [`coop-cloud/traefik`]
3. `abra app new custom-html`
4. `abra app YOURAPPDOMAIN config` - be sure to change `$DOMAIN` to something that resolves to
4. `abra app config YOURAPPDOMAIN` - be sure to change `$DOMAIN` to something that resolves to
your Docker swarm box
5. `abra app YOURAPPDOMAIN deploy`
5. `abra app deploy YOURAPPDOMAIN`
6. Copy your files to the container, using something like
```
abra app YOURAPPDOMAIN cp index.html app:/usr/share/nginx/html

View File

@ -1,2 +1,2 @@
export NGINX_DEFAULT_CONF_VERSION=v1
export NGINX_DEFAULT_CONF_VERSION=v5
export ENTRYPOINT_CONF_VERSION=v3

View File

@ -23,7 +23,10 @@ services:
- "backupbot.backup=true"
- "backupbot.backup.path=/usr/share/nginx/html"
environment:
DEFAULT_CONF_FILE: /etc/nginx/conf.d/default.conf
- DEFAULT_CONF_FILE=/etc/nginx/conf.d/default.conf
- REDIRECT_FROM_PATH
- REDIRECT_TO_URL
- REDIRECT_TYPE
volumes:
- content:/usr/share/nginx/html
configs:
@ -42,7 +45,8 @@ volumes:
configs:
nginx_default_conf:
name: ${STACK_NAME}_nginx_default_conf_${NGINX_DEFAULT_CONF_VERSION}
file: default.conf
file: default.conf.tmpl
template_driver: golang
networks:
proxy:

View File

@ -10,10 +10,18 @@ server {
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ $uri.html;
{{ if env "REDIRECT_TO_URL" }}
rewrite ^{{ env "REDIRECT_FROM_PATH" }}(.*)$ {{ env "REDIRECT_TO_URL" }}$1 {{ env "REDIRECT_TYPE" }};
{{ end }}
try_files $uri $uri/ $uri.html =404;
}
#error_page 404 /404.html;
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
# redirect server error pages to the static page /50x.html
#