diff options
| -rw-r--r-- | .gitmodules | 3 | ||||
| -rw-r--r-- | docker/crupest-nginx/Dockerfile | 10 | ||||
| m--------- | docker/crupest-nginx/sites/blog | 0 | ||||
| -rw-r--r-- | template/nginx/redirect.conf.template | 12 | ||||
| -rw-r--r-- | template/nginx/reverse-proxy.conf.template | 2 | ||||
| -rw-r--r-- | template/nginx/server.json | 13 | ||||
| -rw-r--r-- | template/nginx/static-file.conf.template | 6 | 
7 files changed, 27 insertions, 19 deletions
| diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..0418492 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "docker/crupest-nginx/sites/blog"] +	path = docker/crupest-nginx/sites/blog +	url = https://github.com/crupest/blog diff --git a/docker/crupest-nginx/Dockerfile b/docker/crupest-nginx/Dockerfile index e5e4755..9b9c7b7 100644 --- a/docker/crupest-nginx/Dockerfile +++ b/docker/crupest-nginx/Dockerfile @@ -1,8 +1,14 @@ -FROM node:latest AS build +FROM node:latest AS build-www  RUN npm install -g pnpm  COPY sites/www /sites/www  WORKDIR /sites/www  RUN pnpm install --frozen-lockfile && pnpm run build +FROM klakegg/hugo AS build-blog +COPY sites/blog /hugo +WORKDIR /hugo +RUN hugo +  FROM nginx:latest -COPY --from=build /sites/www/dist /srv/www +COPY --from=build-www /sites/www/dist /srv/www +COPY --from=build-blog /hugo/public /srv/blog diff --git a/docker/crupest-nginx/sites/blog b/docker/crupest-nginx/sites/blog new file mode 160000 +Subproject 420d916ab73c6b51c0cbcccce8d70824ac18147 diff --git a/template/nginx/redirect.conf.template b/template/nginx/redirect.conf.template index 8d6d8fa..b3122e2 100644 --- a/template/nginx/redirect.conf.template +++ b/template/nginx/redirect.conf.template @@ -3,9 +3,9 @@ server {      listen [::]:443 ssl http2;      server_name ${CRUPEST_NGINX_SUBDOMAIN}.${CRUPEST_DOMAIN}; -		location / { -		    return 301 ${CRUPEST_NGINX_URL}$request_uri; -		} +	location / { +	    return 301 ${CRUPEST_NGINX_URL}$request_uri; +	}  }  server { @@ -13,9 +13,9 @@ server {      listen [::]:80;      server_name ${CRUPEST_NGINX_SUBDOMAIN}.${CRUPEST_DOMAIN}; -		location / { -		    return 301 ${CRUPEST_NGINX_URL}$request_uri; -		} +	location / { +	    return 301 ${CRUPEST_NGINX_URL}$request_uri; +	}      location /.well-known/acme-challenge {          root /srv/acme; diff --git a/template/nginx/reverse-proxy.conf.template b/template/nginx/reverse-proxy.conf.template index 99184e0..4cb8b33 100644 --- a/template/nginx/reverse-proxy.conf.template +++ b/template/nginx/reverse-proxy.conf.template @@ -17,6 +17,8 @@ server {          proxy_set_header X-Real-IP $remote_addr;          proxy_pass http://${CRUPEST_NGINX_UPSTREAM_NAME};      } +     +    client_max_body_size 5G;  }  server { diff --git a/template/nginx/server.json b/template/nginx/server.json index dc3904d..459e74e 100644 --- a/template/nginx/server.json +++ b/template/nginx/server.json @@ -11,14 +11,6 @@          },          {              "type": "reverse-proxy", -            "subdomain": "blog", -            "upstream": { -                "name": "halo", -                "server": "halo:8090" -            } -        }, -        { -            "type": "reverse-proxy",              "subdomain": "timeline",              "upstream": {                  "name": "timeline", @@ -26,6 +18,11 @@              }          },          { +            "type": "static-file", +            "subdomain": "blog", +            "root": "/srv/blog" +        }, +        {              "type": "redirect",              "subdomain": "github",              "url": "https://github.com/crupest" diff --git a/template/nginx/static-file.conf.template b/template/nginx/static-file.conf.template index e35ccf3..3022886 100644 --- a/template/nginx/static-file.conf.template +++ b/template/nginx/static-file.conf.template @@ -3,9 +3,9 @@ server {      listen [::]:443 ssl http2;      server_name ${CRUPEST_NGINX_SUBDOMAIN}.${CRUPEST_DOMAIN}; -    root ${CRUPEST_NGINX_ROOT}; - -    client_max_body_size 5G; +    location / { +        root ${CRUPEST_NGINX_ROOT}; +    }  }  server { | 
