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
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 http://roostreams.com . Note that its not installed yet, but you should still see the CSS from the installer.
My nginx.conf
EDIT: My config was not pasting nicely
EDIT 2: It still isn't :X. Guess today is not my day.
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 http://roostreams.com . 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 www.roostreams.com roostreams.com;
location / {
root /srv/http/roostreams.com;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /srv/http/roostreams.com$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.
Tagged:
0
Comments
location ~ \.css { add_header Content-Type text/css; } location ~ \.js { add_header Content-Type application/x-javascript; }
Everything is working correctly now.