Cheers, Adnan RIHAN.
Président-Fondateur de l’association Virtual-Info (Loi 1901),
hébergement Web et Serveurs de jeux.
Technicien-Supérieur développeur d’applications Web et Système.
3e année à {Epitech}.
Envoyé de mon iPhone
When you use the types directive, it replaces all the types with
whatever you specify. You don’t define any mimetypes besides mp3, so
Nginx uses the default (application/octet-stream) for anything it
doesn’t recognize, which now includes css.
But, after rebuilding vhost and restarted nginx, the mp3 are currently
audio/mpeg (referring to firefox).
Is there a way to check if the config is correctly “set” ?
On Wed, 2012-03-28 at 09:48 +0200, Adnan RIHAN wrote:
Which vhost is the one in question? Can you paste only the relevant
server block? Most of what you pasted appears to be specific to running
cPanel (I don’t have any cPanel installs to check).
Also, you mention stuff in “custom”, but I don’t see where any of the
config you pasted includes a “custom” config.
Which vhost is the one in question? Can you paste only the relevant
server block?
@Cliff: I didn’t find them I’ve asked the CPanel module devs to tell
me where are the vhosts. Actually, I think nginx is just a “proxy” to
apache, but it’s strange… It means apache is still running and
.htaccess working… I’ll tell you as soon as I have the response.
Also, you mention stuff in “custom”, but I don’t see where any of the
config you pasted includes a “custom” config.
My custom conf is in “/custom/”. This is what I had before @locojohn
tip.
For the following to work you need headers module installed:
Sorry but, what do you mean? Isn’t “headers” a standard module ? How to
check the compiled modules please ?
Adnan, if it doesn’t set the “Content-Disposition” header as per my
example, then it doesn’t match the location in which this header is set.
It is likely that some other location has preference and so the code I
provided will never be triggered. Look into your nginx config more
closely. Also, check the error log, do you get any warnings?
Sometimes, PCRE library may throw a warning, maybe you can use
alternative location syntax compatible with an older version of PCRE:
Apache is still listening on :8888
Is there a chance with this conf, to match any “location” as there is no
“document_root” or equivalent ?
I mean, location is system based or URL based?
If it’s system, I don’t know. If it’s URL based, there should be a match
since the first test.
Isn’t it ?
On Wed, 2012-03-28 at 19:15 -0400, locojohn wrote:
Adnan, if it doesn’t set the “Content-Disposition” header as per my
example, then it doesn’t match the location in which this header is set.
It is likely that some other location has preference and so the code I
provided will never be triggered.
I’m fairly certain this is exactly what is happening. Either solution
should work fine, but only if the location is properly matched.
Again, it’s not the preferred solution, but directly editing mime.types
would probably work.
The “CPNginx” devs have a website with a ticket support system, but
they’re telling me that they don’t support custom configuration…
I’ve told them I need their help because they know how they built their
module and how they made it work, they still just answer “You need to do
it by yourself”…
Here are some news.
I’ve compiled nginx with HttpHeadersMoreModule
(Headers More | NGINX), to add custom
headers in order to see if the location is or isn’t matched.
Look in your config file. Be aware of “include” directives. Look in
every server{} block. Look at “listen” and “server_name” directives in
each server{} block.
Identify which one server{} block is being used to handle this request.
Post the config for that server{}.
(If you can additionally identify which one location{} block within
that server{} block is being used for this request, then you could
limit what you post to: the server{} block outside of all location{}s,
plus the content of that one location{}. But that’s probably more work
than is necessary.)
If you can enable the debug log (will probably require rebuilding
nginx), then you will see lots of information about what nginx thinks
is happening.
But posting the relevant part of the config file is the best way to make
it easy for people help you.
I knew that location are matched 1 time but I didn’t noticed the |mp3
T_T
Thank you very much, I’m understanding more and more nginx.
I think it’s done, I just have to deal with the CPanel NGinx module devs
to change include place (in order to avoid this case another time).