mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-09-18 01:16:54 +08:00
docker-compose is made in one, volume for error & access log, better tagging for docker
This commit is contained in:
@@ -4,16 +4,9 @@
|
||||
state: directory
|
||||
loop:
|
||||
- /compose
|
||||
- /compose/nginx
|
||||
- /compose/volumes
|
||||
- /compose/volumes/nginx
|
||||
|
||||
- name: Ensure docker-compose file has been updated
|
||||
template:
|
||||
src: "{{item}}"
|
||||
dest: /compose/nginx/
|
||||
loop:
|
||||
- docker-compose.yml
|
||||
- /compose/volumes/nginx/log/{{ kuma_domain }}
|
||||
|
||||
- name: Ensure nginx config directory exist
|
||||
copy:
|
||||
@@ -27,9 +20,3 @@
|
||||
template:
|
||||
src: "nginx.conf"
|
||||
dest: /compose/volumes/nginx/nginx.conf
|
||||
|
||||
- name: Ensure nginx is up
|
||||
community.docker.docker_compose:
|
||||
state: present
|
||||
project_src: /compose/nginx
|
||||
pull: no
|
||||
|
@@ -1,8 +0,0 @@
|
||||
version: '3.3'
|
||||
services:
|
||||
nginx:
|
||||
network_mode: host
|
||||
restart: always
|
||||
image: nginx:stable-alpine
|
||||
volumes:
|
||||
- '/compose/volumes/nginx/:/etc/nginx/'
|
@@ -67,8 +67,8 @@ http {
|
||||
server_name {{ kuma_domain }};
|
||||
listen 443 ssl http2 default_server;
|
||||
|
||||
access_log /var/log/nginx/yoursite.access.log main;
|
||||
error_log /var/log/nginx/yoursite.error.log;
|
||||
access_log /var/log/nginx/{{ kuma_domain }}.access.log main;
|
||||
error_log /var/log/nginx/{{ kuma_domain }}.error.log;
|
||||
|
||||
location / {
|
||||
# rewrite ^/(.*)/$ /$1 permanent;
|
||||
@@ -79,7 +79,7 @@ http {
|
||||
# }
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://localhost:3001/;
|
||||
proxy_pass http://uptime-kuma:3001/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
Reference in New Issue
Block a user