summaryrefslogtreecommitdiff
path: root/installation
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2020-09-21 16:19:08 -0500
committerMark Felder <feld@FreeBSD.org>2020-09-21 16:19:08 -0500
commit8906f30ba16bdd91ac51ab9d4568c19070c270d5 (patch)
treec80df1ea77d61a6ca53ce0309915d0d2c9d4a8a0 /installation
parentade7fede7134d0e05c91ef48d52e48e64fd6dd98 (diff)
Use an upstream for reverse proxy so future modifications are simplified
Diffstat (limited to 'installation')
-rw-r--r--installation/pleroma.nginx14
1 files changed, 9 insertions, 5 deletions
diff --git a/installation/pleroma.nginx b/installation/pleroma.nginx
index 5517e3fc3..d613befd2 100644
--- a/installation/pleroma.nginx
+++ b/installation/pleroma.nginx
@@ -9,6 +9,12 @@
proxy_cache_path /tmp/pleroma-media-cache levels=1:2 keys_zone=pleroma_media_cache:10m max_size=10g
inactive=720m use_temp_path=off;
+# this is explicitly IPv4 since Pleroma.Web.Endpoint binds on IPv4 only
+# and `localhost.` resolves to [::0] on some systems: see issue #930
+upstream phoenix {
+ server 127.0.0.1:4000 max_fails=5 fail_timeout=60s;
+}
+
server {
server_name example.tld;
@@ -72,9 +78,7 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location / {
- # this is explicitly IPv4 since Pleroma.Web.Endpoint binds on IPv4 only
- # and `localhost.` resolves to [::0] on some systems: see issue #930
- proxy_pass http://127.0.0.1:4000;
+ proxy_pass http://phoenix;
}
location ~ ^/(media|proxy) {
@@ -87,11 +91,11 @@ server {
proxy_ignore_client_abort on;
proxy_buffering on;
chunked_transfer_encoding on;
- proxy_pass http://127.0.0.1:4000;
+ proxy_pass http://phoenix;
}
location /api/fedsocket/v1 {
proxy_request_buffering off;
- proxy_pass http://127.0.0.1:4000/api/fedsocket/v1;
+ proxy_pass http://phoenix/api/fedsocket/v1;
}
}