Try new Nginx config

This commit is contained in:
Mo 2023-08-27 23:09:18 +02:00
parent 0fc4a5bfd0
commit ce3b0156f0
4 changed files with 50 additions and 16 deletions

View file

@ -1,10 +1,20 @@
#!/usr/bin/env fish
set -l container_name mo8it_com
set -l container_name mo8it-com
buildah build --layers -t $container_name:latest ~/code/mo8it.com
mkdir -p ~/volumes/$container_name
podman run \
--rm \
-v ~/code/mo8it.com:/volumes/src:Z,ro \
-v ~/volumes/$container_name:/volumes/public:Z \
-w /volumes/src \
ghcr.io/getzola/zola:v0.17.2 build -o /volumes/public -f; or return 1
podman-default-create \
$container_name \
--network traefik \
localhost/$container_name:latest
-v ~/sync/volumes/nginx.conf:/etc/nginx/nginx.conf:z,ro \
-v ~/volumes/$container_name:/usr/share/nginx/html:Z,ro \
--label "io.containers.autoupdate=registry" \
docker.io/library/nginx:alpine

36
volumes/nginx.conf Normal file
View file

@ -0,0 +1,36 @@
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log error;
events {
worker_connections 1024;
}
http {
charset utf-8;
access_log off;
log_not_found off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
gzip on;
server_tokens off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
root /usr/share/nginx/html;
index index.html;
location / {
}
error_page 404 /404.html;
}
}

View file

@ -1,11 +0,0 @@
server {
listen 80;
server_name how-to-linux.mo8it.com;
location / {
root /volumes/sites/how-to-linux.mo8it.com;
index index.html;
}
error_page 404 /404.html;
}

View file

@ -136,7 +136,6 @@ http:
certResolver: le
{{ end }}
services:
nginx:
loadBalancer:
@ -193,7 +192,7 @@ http:
mo8it_com:
loadBalancer:
servers:
- url: http://mo8it_com
- url: http://mo8it-com
juna_li_com:
loadBalancer:
servers: