FIX: Have nginx always pass `/uploads/short-url` requests to app.

FIX: Have nginx always pass /uploads/short-url requests to app.

Follow up to f0620e7118a76a1faea0ca15ac554818f8bb1bcf

diff --git a/config/nginx.sample.conf b/config/nginx.sample.conf
index 6ea850c..5e67988 100644
--- a/config/nginx.sample.conf
+++ b/config/nginx.sample.conf
@@ -91,11 +91,21 @@ server {
     # auth_basic on;
     # auth_basic_user_file /etc/nginx/htpasswd;
 
+    location ~ ^/uploads/short-url/ {
+      proxy_set_header Host $http_host;
+      proxy_set_header X-Real-IP $remote_addr;
+      proxy_set_header X-Request-Start "t=${msec}";
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+      proxy_set_header X-Forwarded-Proto $thescheme;
+      proxy_pass http://discourse;
+      break;
+    }
+
     location ~* (assets|plugins|uploads)/.*\.(eot|ttf|woff|woff2|ico)$ {
       expires 1y;
       add_header Cache-Control public,immutable;
       add_header Access-Control-Allow-Origin *;
-     }
+    }
 
     location = /srv/status {
       access_log off;

GitHub sha: c920f9d1

1 Like

This commit has been mentioned on Discourse Meta. There might be relevant details there: