]> Untitled Git - lemmy.git/blobdiff - docker/federation/nginx.conf
Isomorphic docker (#1124)
[lemmy.git] / docker / federation / nginx.conf
index a73b0954e24fc18e7d4f0a005c783fb10a8de838..f787a9d2f8225d866595ba4cf633e49f8e9c5bb7 100644 (file)
@@ -11,25 +11,21 @@ http {
         # Upload limit for pictshare
         client_max_body_size 50M;
 
-        location / {
-            proxy_pass http://lemmy_alpha:8540;
-            proxy_set_header X-Real-IP $remote_addr;
-            proxy_set_header Host $host;
-            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-
-            # WebSocket support
+        location /api/v1 {
+            proxy_pass http://lemmy-alpha:8541/api/v1;
             proxy_http_version 1.1;
             proxy_set_header Upgrade $http_upgrade;
             proxy_set_header Connection "upgrade";
         }
-
-        location /pictshare/ {
-            proxy_pass http://pictshare_alpha:80/;
+        location / {
+            proxy_pass http://lemmy-alpha-ui:1234;
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header Host $host;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-        }
 
+            # Cuts off the trailing slash on URLs to make them valid
+            rewrite ^(.+)/+$ $1 permanent;
+        }
         location /iframely/ {
             proxy_pass http://iframely:80/;
             proxy_set_header X-Real-IP $remote_addr;
@@ -46,25 +42,52 @@ http {
         # Upload limit for pictshare
         client_max_body_size 50M;
 
+        location /api/v1 {
+            proxy_pass http://lemmy-beta:8551/api/v1;
+            proxy_http_version 1.1;
+            proxy_set_header Upgrade $http_upgrade;
+            proxy_set_header Connection "upgrade";
+        }
         location / {
-            proxy_pass http://lemmy_beta:8550;
+            proxy_pass http://lemmy-beta-ui:1234;
+            proxy_set_header X-Real-IP $remote_addr;
+            proxy_set_header Host $host;
+            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+
+            # Cuts off the trailing slash on URLs to make them valid
+            rewrite ^(.+)/+$ $1 permanent;
+        }
+        location /iframely/ {
+            proxy_pass http://iframely:80/;
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header Host $host;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+        }
+    }
+
+    server {
+        listen 8560;
+        server_name 127.0.0.1;
+        access_log off;
+
+        # Upload limit for pictshare
+        client_max_body_size 50M;
 
-            # WebSocket support
+        location /api/v1 {
+            proxy_pass http://lemmy-gamma:8561/api/v1;
             proxy_http_version 1.1;
             proxy_set_header Upgrade $http_upgrade;
             proxy_set_header Connection "upgrade";
         }
-
-        location /pictshare/ {
-            proxy_pass http://pictshare_beta:80/;
+        location / {
+            proxy_pass http://lemmy-gamma-ui:1234;
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header Host $host;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-        }
 
+            # Cuts off the trailing slash on URLs to make them valid
+            rewrite ^(.+)/+$ $1 permanent;
+        }
         location /iframely/ {
             proxy_pass http://iframely:80/;
             proxy_set_header X-Real-IP $remote_addr;
@@ -74,32 +97,59 @@ http {
     }
 
     server {
-        listen 8560;
+        listen 8570;
         server_name 127.0.0.1;
         access_log off;
 
         # Upload limit for pictshare
         client_max_body_size 50M;
 
+        location /api/v1 {
+            proxy_pass http://lemmy-delta:8571/api/v1;
+            proxy_http_version 1.1;
+            proxy_set_header Upgrade $http_upgrade;
+            proxy_set_header Connection "upgrade";
+        }
         location / {
-            proxy_pass http://lemmy_gamma:8560;
+            proxy_pass http://lemmy-delta-ui:1234;
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header Host $host;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 
-            # WebSocket support
+            # Cuts off the trailing slash on URLs to make them valid
+            rewrite ^(.+)/+$ $1 permanent;
+        }
+        location /iframely/ {
+            proxy_pass http://iframely:80/;
+            proxy_set_header X-Real-IP $remote_addr;
+            proxy_set_header Host $host;
+            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+        }
+    }
+
+    server {
+        listen 8580;
+        server_name 127.0.0.1;
+        access_log off;
+
+        # Upload limit for pictshare
+        client_max_body_size 50M;
+
+        location /api/v1 {
+            proxy_pass http://lemmy-epsilon:8581/api/v1;
             proxy_http_version 1.1;
             proxy_set_header Upgrade $http_upgrade;
             proxy_set_header Connection "upgrade";
         }
-
-        location /pictshare/ {
-            proxy_pass http://pictshare_gamma:80/;
+        location / {
+            proxy_pass http://lemmy-epsilon-ui:1234;
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header Host $host;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-        }
 
+            # Cuts off the trailing slash on URLs to make them valid
+            rewrite ^(.+)/+$ $1 permanent;
+        }
         location /iframely/ {
             proxy_pass http://iframely:80/;
             proxy_set_header X-Real-IP $remote_addr;