]> Untitled Git - lemmy.git/blobdiff - ansible/templates/nginx.conf
Fixing nginx.conf, adding nginx config update to releases.md.
[lemmy.git] / ansible / templates / nginx.conf
index 6a5990a70fcf63fb960c2ba8dd60af51358225bc..b710fdb30bde9bf543afd572ccf44d1c70c10c9c 100644 (file)
@@ -70,20 +70,21 @@ server {
         proxy_cache_min_uses    5;
     }    
 
-    location /pictrs/image/ {
-      proxy_pass http://0.0.0.0:8537/;
-      proxy_set_header X-Real-IP $remote_addr;
-      proxy_set_header Host $host;
-      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    # Redirect pictshare images to pictrs
+    location ~ /pictshare/(.*)$ {
+      return 301 /pictrs/image/$1;
+    }
 
-      # Block the import
-      location /pictrs/import {
-        return 403;
+    # pict-rs images
+    location /pictrs {
+      location /pictrs/image {
+        proxy_pass http://0.0.0.0:8537/image;
+        proxy_set_header X-Real-IP $remote_addr;
+        proxy_set_header Host $host;
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       }
-
-      if ($request_uri ~ \.(?:ico|gif|jpe?g|png|webp|bmp|mp4)$) {
-        add_header Cache-Control "public, max-age=31536000, immutable";
-      }   
+      # Block the import
+      return 403;
     }
 
     location /iframely/ {