2022-05-20 21:21:26 +02:00
|
|
|
---
|
|
|
|
title: Komga
|
|
|
|
---
|
|
|
|
|
2022-06-06 18:37:14 +02:00
|
|
|
[toc]
|
2022-05-20 21:21:26 +02:00
|
|
|
## Create directories
|
2022-06-12 15:46:12 +02:00
|
|
|
`# mkdir -p /var/komga/{config,content}`
|
|
|
|
`# mkdir -p /var/komga/content/{manga,books,tech}`
|
2022-05-20 21:21:26 +02:00
|
|
|
|
2022-06-12 15:46:12 +02:00
|
|
|
## Run Komga
|
2022-05-20 21:21:26 +02:00
|
|
|
```
|
2022-06-12 15:46:12 +02:00
|
|
|
# podman run --name komga -p 8080:8080 \
|
|
|
|
-v /var/komga/config:/config \
|
|
|
|
-v /var/komga/content:/content \
|
2022-05-20 21:21:26 +02:00
|
|
|
--restart unless-stopped \
|
2022-06-12 15:46:12 +02:00
|
|
|
-d docker.io/gotson/komga:latest
|
2022-05-20 21:21:26 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## Nginx Config
|
|
|
|
```
|
|
|
|
server {
|
2022-06-12 15:46:12 +02:00
|
|
|
server_name komga.exu.li;
|
2022-05-20 21:21:26 +02:00
|
|
|
|
|
|
|
# Security / XSS Mitigation Headers
|
|
|
|
add_header X-Frame-Options "SAMEORIGIN";
|
|
|
|
add_header X-XSS-Protection "1; mode=block";
|
|
|
|
add_header X-Content-Type-Options "nosniff";
|
|
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
|
|
|
|
|
|
|
|
location / {
|
|
|
|
# Proxy main traffic
|
2022-06-12 15:46:12 +02:00
|
|
|
proxy_pass http://172.16.53.100:8080;
|
2022-05-20 21:21:26 +02:00
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
proxy_set_header X-Forwarded-Protocol $scheme;
|
|
|
|
proxy_set_header X-Forwarded-Host $http_host;
|
|
|
|
}
|
|
|
|
|
|
|
|
listen *:443 ssl http2; #set ipv6 address
|
2022-06-12 15:46:12 +02:00
|
|
|
ssl_certificate_key /etc/acme-sh/komga.exu.li/key.pem;
|
|
|
|
ssl_certificate /etc/acme-sh/komga.exu.li/cert.pem;
|
2022-05-20 21:21:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2022-06-12 15:46:12 +02:00
|
|
|
if ($host = komga.exu.li) {
|
2022-05-20 21:21:26 +02:00
|
|
|
return 301 https://$host$request_uri;
|
|
|
|
}
|
|
|
|
|
|
|
|
listen *:80; #set ipv6 address
|
2022-06-12 15:46:12 +02:00
|
|
|
server_name komga.exu.li;
|
2022-05-20 21:21:26 +02:00
|
|
|
return 404;
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Systemd Service
|
2022-06-12 15:48:19 +02:00
|
|
|
> See [Podman](/linux/podman#generate-systemd-service) to generate a service file.
|