summaryrefslogtreecommitdiffstats
path: root/ansible/templates
diff options
context:
space:
mode:
authorFelix <me@nutomic.com>2020-03-11 00:22:34 +0100
committerFelix <me@nutomic.com>2020-03-11 01:05:50 +0100
commit6c31a1f9ccfe3e5bf54269e6c594c120dff62c16 (patch)
treec45e2f5dab187ea9b680c5c4965b45fad90a59ee /ansible/templates
parent4fbf55d79e355608c75aa8218cd7f487c58fa04d (diff)
Deploy multiple Lemmy instances to the same server (ref #474)
Diffstat (limited to 'ansible/templates')
-rw-r--r--ansible/templates/docker-compose.yml6
-rw-r--r--ansible/templates/nginx.conf14
2 files changed, 10 insertions, 10 deletions
diff --git a/ansible/templates/docker-compose.yml b/ansible/templates/docker-compose.yml
index 57ee142a..e96b312c 100644
--- a/ansible/templates/docker-compose.yml
+++ b/ansible/templates/docker-compose.yml
@@ -4,7 +4,7 @@ services:
lemmy:
image: {{ lemmy_docker_image }}
ports:
- - "127.0.0.1:8536:8536"
+ - "127.0.0.1:{{ lemmy_port }}:8536"
restart: always
volumes:
- ./lemmy.hjson:/config/config.hjson:ro
@@ -26,7 +26,7 @@ services:
pictshare:
image: shtripok/pictshare:latest
ports:
- - "127.0.0.1:8537:80"
+ - "127.0.0.1:{{ pictshare_port }}:80"
volumes:
- ./volumes/pictshare:/usr/share/nginx/html/data
restart: always
@@ -34,7 +34,7 @@ services:
iframely:
image: dogbin/iframely:latest
ports:
- - "127.0.0.1:8061:80"
+ - "127.0.0.1:{{ iframely_port }}:80"
volumes:
- ./iframely.config.local.js:/iframely/config.local.js:ro
restart: always
diff --git a/ansible/templates/nginx.conf b/ansible/templates/nginx.conf
index 04e5a643..003720bc 100644
--- a/ansible/templates/nginx.conf
+++ b/ansible/templates/nginx.conf
@@ -1,4 +1,4 @@
-proxy_cache_path /var/cache/lemmy_frontend levels=1:2 keys_zone=lemmy_frontend_cache:10m max_size=100m use_temp_path=off;
+proxy_cache_path /var/cache/lemmy/{{ domain }} levels=1:2 keys_zone=lemmy_frontend_cache_{{ domain }}:10m max_size=100m use_temp_path=off;
server {
listen 80;
@@ -52,7 +52,7 @@ server {
client_max_body_size 50M;
location / {
- proxy_pass http://0.0.0.0:8536;
+ proxy_pass http://0.0.0.0:{{ lemmy_port }};
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -63,7 +63,7 @@ server {
proxy_set_header Connection "upgrade";
# Proxy Cache
- proxy_cache lemmy_frontend_cache;
+ proxy_cache lemmy_frontend_cache_{{ domain }};
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
proxy_cache_revalidate on;
proxy_cache_lock on;
@@ -71,7 +71,7 @@ server {
}
location /pictshare/ {
- proxy_pass http://0.0.0.0:8537/;
+ proxy_pass http://0.0.0.0:{{ pictshare_port }}/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -82,7 +82,7 @@ server {
}
location /iframely/ {
- proxy_pass http://0.0.0.0:8061/;
+ proxy_pass http://0.0.0.0:{{ iframely_port }}/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -98,6 +98,6 @@ map $remote_addr $remote_addr_anon {
::1 $remote_addr;
default 0.0.0.0;
}
-log_format main '$remote_addr_anon - $remote_user [$time_local] "$request" '
+log_format main_{{ domain }} '$remote_addr_anon - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" "$http_user_agent"';
-access_log /var/log/nginx/access.log main;
+access_log /var/log/nginx/access.log main_{{ domain }};