mime type not set correctly for webpage

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

mime type not set correctly for webpage

Diana Eichert
"I'm trying to get rainloop  PHP webmail setup on a mail server using
OpenBSD 6.9 httpd

I have the webserver configured however the browser shows the mime
type is not correct for the css style sheet.
From Firefox console,
"The stylesheet
https://mail.shopnet.com/rainloop/rainloop/v/1.16.0/static/css/app.min.css?standard
was not loaded because its MIME type, “text/html”, is not “text/css”.

I included system mime file types in httpd.conf file as below.

Any pointers are appreciated.

thanks


# $OpenBSD: httpd.conf,v 1.20 2018/06/13 15:08:24 reyk Exp $

types { include "/usr/share/misc/mime.types" }

server "mail.shopnet.com" {
        listen on * port 80
        location "/.well-known/acme-challenge/*" {
                root "/acme"
                request strip 2
        }
        location * {
                block return 302 "https://$HTTP_HOST$REQUEST_URI"
        }
}

server "mail.shopnet.com" {
        listen on * tls port 443
        tls {
                certificate "/etc/ssl/mail.shopnet.com.fullchain.pem"
                key "/etc/ssl/private/mail.shopnet.com.key"
        }
        location "/pub/*" {
                directory auto index
        }
        location "/.well-known/acme-challenge/*" {
                root "/acme"
                request strip 2
        }
        location "/rainloop/*" {
                fastcgi param SCRIPT_FILENAME "/htdocs/rainloop/index.php"
                fastcgi socket "/run/php-fpm.sock"
#               directory index "index.php"
        }

        # Value below is 25MB in bytes. 1MB = 1048576 bytes
        connection max request body 26214400
        location "/data*" {
                block return 403
        }

        location "/rainloop/*.php*" {
                fastcgi socket "/run/php-fpm.sock"
        }
}

Reply | Threaded
Open this post in threaded view
|

Re: mime type not set correctly for webpage

Joseph Olatt
On Thu, Jun 17, 2021 at 10:19:12PM -0600, Diana Eichert wrote:

> "I'm trying to get rainloop  PHP webmail setup on a mail server using
> OpenBSD 6.9 httpd
>
> I have the webserver configured however the browser shows the mime
> type is not correct for the css style sheet.
> >From Firefox console,
> "The stylesheet
> https://mail.shopnet.com/rainloop/rainloop/v/1.16.0/static/css/app.min.css?standard
> was not loaded because its MIME type, ???text/html???, is not ???text/css???.
>
> I included system mime file types in httpd.conf file as below.
>
> Any pointers are appreciated.

My suspicion is that the extension is being assumed to be
".css?standard".

So, try changing the following line in /usr/share/misc/mime.types:

  text/css                                                css

to:

  text/css                                                css css?standard

restart httpd and see if resolves your problem.

This is just a thought.


>
> thanks
>
>
> # $OpenBSD: httpd.conf,v 1.20 2018/06/13 15:08:24 reyk Exp $
>
> types { include "/usr/share/misc/mime.types" }
>
> server "mail.shopnet.com" {
>         listen on * port 80
>         location "/.well-known/acme-challenge/*" {
>                 root "/acme"
>                 request strip 2
>         }
>         location * {
>                 block return 302 "https://$HTTP_HOST$REQUEST_URI"
>         }
> }
>
> server "mail.shopnet.com" {
>         listen on * tls port 443
>         tls {
>                 certificate "/etc/ssl/mail.shopnet.com.fullchain.pem"
>                 key "/etc/ssl/private/mail.shopnet.com.key"
>         }
>         location "/pub/*" {
>                 directory auto index
>         }
>         location "/.well-known/acme-challenge/*" {
>                 root "/acme"
>                 request strip 2
>         }
>         location "/rainloop/*" {
>                 fastcgi param SCRIPT_FILENAME "/htdocs/rainloop/index.php"
>                 fastcgi socket "/run/php-fpm.sock"
> #               directory index "index.php"
>         }
>
>         # Value below is 25MB in bytes. 1MB = 1048576 bytes
>         connection max request body 26214400
>         location "/data*" {
>                 block return 403
>         }
>
>         location "/rainloop/*.php*" {
>                 fastcgi socket "/run/php-fpm.sock"
>         }
> }