Hi, just a question for anyone out there who may know... with xenforo "pretty url's" and how the attachments are presented, does xenforo append .html to attachments during the normal course?
I know with pretty rewrites off it runs through /index.php?attachments, not sure what happens when 'on', or what handles it internally.
I ask only as I am working on some pcre rewriting for nginx and I'm not entirely sure if it's me on the nginx end or xenforo appending that index.html. Needless to say, image URL's return a 404, so it's probably my crappy rewrite?
Thanks for the reply, narrows it down for me... If a mod reads this perhaps it can be moved to server/troubleshooting.
I'm trying to prevent attachment hotlinking in nginx, not .jpg files the ID extensions actual attachments use. The regex seems correct, I can get things to work with pretty url's off, but not when on. (config for testing only - location security not added)
Redirect will always work but with pretty url's the image attachment itself will 404.
[error] 12819#0: *7508 ".../attachments/someimage-jpg.3/index.html" is not found (2: No such file or directory), client: xxx.xxx.x.xx, server: domain.com, request: "GET /attachments/someimage-jpg.3/ HTTP/1.1", host: "domain.com", referrer: "http://domain.com/threads/sdaasd-asdada-asdadsasd-asdad.2/"
But the hotlink image with still redirect regardless, if linked elsewhere. Debug log is not helping.
index index.html index.php;
Remove index.html and it becomes
.../attachments/someimage-jpg.3/index.php" is not found
From what I understand, Nginx only matches one location block per request "attempt" (try_files retries the attempt with the new URL). So basically, the try_files block isn't being hit after your referrer block... block. I don't know what the best practice is here unfortunately.