Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Troubles with css mime-types, nginx/php-fpm

edited April 2011 in Vanilla 2.0 - 2.8
I attempted to set up vanilla on a fresh nginx/php-fpm install this morning, and found that none of the CSS (and likely JS) works. Checking my access logs, nginx does serve my style.css to the user, but the browser is not using it.

Upon further investigation (using wget), I found that nginx (or is php-fpm the culprit?!) is returning text/html as the mimetype for these files. On the machine itself, the mimetype is text/x-c. I am assuming that nginx is changing it to text/html, but really it needs to be text/css.

I have tried the zip file and the tar.gz (from github) but all the files come out as text/x-c (does this even matter?). Are my extraction tools changing these mime-types? Really not sure what is going on here, or if I am even on the right track.

You can see where I am having problems at . Note that its not installed yet, but you should still see the CSS from the installer.

My nginx.conf

worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name; location / { root /srv/http/; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /srv/http/$fastcgi_script_name; include fastcgi_params; } }

EDIT: My config was not pasting nicely
EDIT 2: It still isn't :X. Guess today is not my day.


  • Options
    edited April 2011
    I have found a solution, but it seems to be a hack at best (I shouldn't have to do this...).

    location ~ \.css { add_header Content-Type text/css; } location ~ \.js { add_header Content-Type application/x-javascript; }

    Everything is working correctly now.
Sign In or Register to comment.