From: Dessalines Date: Mon, 22 Jun 2020 12:31:15 +0000 (-0400) Subject: Updating nginx.conf, upgrading pict-rs X-Git-Url: http://these/git/%7B%60https:/%7B%60css/themes/%22https:/nerdica.net/%7Bpost.url%7D?a=commitdiff_plain;h=cb128256ed9b5779d696d3de599ef94bfe79a2e6;p=lemmy.git Updating nginx.conf, upgrading pict-rs --- diff --git a/ansible/templates/nginx.conf b/ansible/templates/nginx.conf index 6a1c13c1..bdf80bc5 100644 --- a/ansible/templates/nginx.conf +++ b/ansible/templates/nginx.conf @@ -71,23 +71,20 @@ server { } # Redirect pictshare images to pictrs - rewrite ^(/pictshare/.*)$ /pictrs/image/$1; + location ~ /pictshare/(.*)$ { + return 301 /pictrs/image/$1; + } # pict-rs images - 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; - - # Block the import - location /pictrs/import { - return 403; + 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/ { diff --git a/docker/dev/docker-compose.yml b/docker/dev/docker-compose.yml index 2072024f..2575171e 100644 --- a/docker/dev/docker-compose.yml +++ b/docker/dev/docker-compose.yml @@ -28,7 +28,7 @@ services: restart: always pictrs: - image: asonix/pictrs:v0.1.4-r0 + image: asonix/pictrs:v0.1.13-r0 ports: - "127.0.0.1:8537:8080" user: 991:991 diff --git a/docker/prod/docker-compose.yml b/docker/prod/docker-compose.yml index 246a9586..30b17c3c 100644 --- a/docker/prod/docker-compose.yml +++ b/docker/prod/docker-compose.yml @@ -25,14 +25,14 @@ services: - pictshare - iframely - pictshare: - image: hascheksolutions/pictshare:latest - ports: - - "127.0.0.1:8537:80" + pictrs: + image: asonix/pictrs:v0.1.13-r0 + ports: + - "127.0.0.1:8537:8080" + user: 991:991 volumes: - - ./volumes/pictshare:/usr/share/nginx/html/data + - ./volumes/pictrs:/mnt restart: always - mem_limit: 100m iframely: image: dogbin/iframely:latest