Anders (izzno / gooood) π³π΄
so that does not matter
Leonardo
hm
Leonardo
crap
Anders (izzno / gooood) π³π΄
but list the dirs as well
Anders (izzno / gooood) π³π΄
file permissions are as follows user:groux xxx_owner xxx_group xxx_everyone
Anders (izzno / gooood) π³π΄
and everyone can read those files, and if your dir is the same then this is not the proble,
Leonardo
hmmmm got it
Leonardo
so maybe what's the problem then?
Anders (izzno / gooood) π³π΄
I dont know nginx that well im afraid, but i think that is your problem...
Anders (izzno / gooood) π³π΄
I just use nginx as proxies towards "whole" domains.
Anders (izzno / gooood) π³π΄
Then i wrap the aps in docker...
Anders (izzno / gooood) π³π΄
:D
Anders (izzno / gooood) π³π΄
how do you point to media in your templates ?
Leonardo
{{ obj.file.url }}
Anders (izzno / gooood) π³π΄
What does it translate to? (if you view the html ?
Leonardo
do you wanna know what's the value of that attribute?
Anders (izzno / gooood) π³π΄
when you browse your application in production does it translate correctly ?
Leonardo
what you mean with translate?
Anders (izzno / gooood) π³π΄
if you view the webpage source code, does it point to /media/something
Leonardo
probly to media/filename
Anders (izzno / gooood) π³π΄
yes but is it ?
Anders (izzno / gooood) π³π΄
is 22316.pdf in you media dir ?
Leonardo
yes
Leonardo
the file name is this number
Leonardo
Anders (izzno / gooood) π³π΄
yep, strange
Leonardo
pretty
Leonardo
is the same dir then static files
Leonardo
but static works fine
Leonardo
i don't understand what's happening...
Anders (izzno / gooood) π³π΄
open the css and compare the url
Anders (izzno / gooood) π³π΄
and try /static/fakefile.css
Anders (izzno / gooood) π³π΄
look at the feedback, is it canonical or the same as above
Rajjix
are you using nginx ?
Leonardo
Rajjix
can you share your conf please
and your settings urls for media
Leonardo
nginx:
https://pastebin.com/qUArAfab
Leonardo
settings:
https://pastebin.com/KFmUjxJy
Anders (izzno / gooood) π³π΄
your media is one charecter shorter
Anders (izzno / gooood) π³π΄
"whitespace"
Rajjix
can u confirm that django is serving the media file with the correct uri ?
Leonardo
http://ambiente.eranalitica.com.br/static/css/fake.css not found
Leonardo
Rajjix
Ur settings look good
Anders (izzno / gooood) π³π΄
He's static urls are canocal but media is not...
Rajjix
show me the function where you provide the path for the given media
Leonardo
Leonardo
Anders (izzno / gooood) π³π΄
huh?
Does not really matter.... You dont need the white space in front of your alias declarations
Rajjix
Leonardo
yeah i have a whitespace in static/ row too and it's working fine
Leonardo
so that's not a prob
Anders (izzno / gooood) π³π΄
Yes, but theres a difference in the whitespace.
Rajjix
i think the problem is with ur django views function
Anders (izzno / gooood) π³π΄
static has three meda has two, so if it matters.
Leonardo
Anders (izzno / gooood) π³π΄
Leonardo
{{ obj.file.url }}
Anders (izzno / gooood) π³π΄
Hes asking for you code in views.py
Rajjix
what about ownership on your media folder?
Anders (izzno / gooood) π³π΄
We checked that as well ;)
Leonardo
ok the whitespace is equal for both lines
Anders (izzno / gooood) π³π΄
restart nginx
Anders (izzno / gooood) π³π΄
sudo systemctl restart nginx
Leonardo
worked
Leonardo
idk what i did '-'
Leonardo
btw, thank you very much @izznogooood and @Rajjix
Leonardo
i think i know what was the prob
Leonardo
my nginx status was broken
Leonardo
so i changed some file configs and restarted
Leonardo
thank you guys, you're awesome!
Anders (izzno / gooood) π³π΄
👍
Rajjix
Nice 👍
Leonardo
the problem was that lines access_log /home/user/logs/access.log;
error_log /home/user/logs/error.log;
George
:)
Leonardo
the nginx was not finding that log files
Leonardo
appreciate you too @trenixjetix ;)
George
:)