New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect content-type header for XSL files in nginx-fpm image #5457
Comments
Thanks for bringing this up. Could you please verify the location of the problem by using the Do you get this problem with |
We just confirmed that |
Take a look inside the container at /etc/mime.types ( I see
I don't see any other config for this file type; nothing special in nginx config or anywhere else. |
Not sure if I’m doing it right, but here it goes:
|
Interesting. The default for nginx is
So somehow the default is not being overridden by the mime.types config. |
I think the issue is probably that the /etc/nginx/mime.types needs additions. You can explore this by just editing that file and doing |
Exactly where my head was going :) The question is, apache uses the OS default /etc/mime.types. Should nginx be using /etc/mime.types or /etc/nginx/mime.types? |
Just to confirm, I see what @rfay sees when I ssh into DDEV and cat the
|
Maybe if our nginx config could include /etc/mime.types instead of the /etc/nginx/mime.types that might do it. The experiment would be, in /etc/nginx/nginx.conf, line 38: - include mime.types;
+ include /etc/mime.types; then |
A starting place for exploration is just |
So, in digging into this with Alfonso, we discovered:
According to https://www.w3.org/TR/xslt20/#media-type-registration, Solution:
No guarantee of how quickly that will get fixed. Upstream containers are:
Maybe:
I'll throw together a PR for option 2. |
I would say just add /etc/nginx/mime.types to ddev-webserver Dockerfile, using the existing + what you want to add. No sedding required. |
Good call. I did this: if [ "$DDEV_WEBSERVER_TYPE" = "nginx-fpm" ] ; then
awk '/application\/zip/ { print " application/xslt+xml xsl xslt;"; print; next }1' /etc/nginx/mime.types > /tmp/mime.types
mv /tmp/mime.types /etc/nginx/mime.types
elif [ "$DDEV_WEBSERVER_TYPE" = "apache-fpm" ] ; then
a2enmod proxy_fcgi
a2enconf php${DDEV_PHP_VERSION}-fpm
a2dissite 000-default
fi and hated it. I'll do what you suggest. |
Don't override the shipping mime.types or we will need to maintain the whole file. Better to just add what is needed to the http config Resolves: ddev#5457
Don't override the shipping mime.types or we will need to maintain the whole file. Better to just add what is needed to the http config Resolves: ddev#5457
Is there an existing issue for this?
Output of
ddev debug test
Expand `ddev debug test` diagnostic information
Expected Behavior
curl -i "https://mysite.ddev.site/stylesheet.xsl" | grep content-type
content-type: application/xslt+xml
Actual Behavior
curl -i "https://mysite.ddev.site/stylesheet.xsl" | grep content-type
content-type: application/octet-stream
The mimetype is incorrect for XSL files and will break the ability to process XSL from an XML file that includes it.
Steps To Reproduce
Anything else?
No response
The text was updated successfully, but these errors were encountered: