mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 17:35:52 +03:00
[GH-ISSUE #2434] Web resources transferred with the wrong MIME type #1706
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#1706
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @albio46 on GitHub (Nov 27, 2022).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2434
Checklist
jc21/nginx-proxy-manager:latestdocker image?Describe the bug
When accessing a proxied server, the browser blocks some resources because of a wrong MIME type
Nginx Proxy Manager Version
v2.9.19
To Reproduce
Steps to reproduce the behavior:
Perhaps it's an issue with custom locations:
There may be errors loading some resources
Expected behavior
Screenshots
Console error
nextcloud, like this because it doesn't load css
homeassistant, stuck here because it doesn't load js
setup screenshots:
NPM, proxy host
and custom locations
Operating System
Raspberry pi (192.168.1.5) with raspberry OS and all the services are on docker, on the same bridge network: NPM (172.19.0.4), portainer (172.19.0.3), nextcloud (172.19.0.5) and homeassistant (172.19.0.2) of which NPM and portainer properly load, while nextcloud and homeassistant fail to load some resources
Additional context
Have tried with firefox and chrome. Accessing directly works fine.
NPM logs are clear, there is the browser request and the file is sent
Logs for a connection to NPM and then portainer
proxy-host-6_access.log
proxy-host-6_error.log
Logs for connections to nextcloud and then homeassistant
proxy-host-6_access.log
proxy-host-6_error.log
@oywino commented on GitHub (Nov 28, 2022):
Using a LAN IP-Address as your domain name, is not correct. It cannot be resolved by DNS. And what is 172.19.0.4 ? You WAN-IP? Also, why did you add a slash ( / ) following the IP-Address in the Custom locations? I believe that's clearly also wrong.
@albio46 commented on GitHub (Nov 28, 2022):
Of course not, I've excluded variables. By referring directly to the host in my Lan I'm sure it's not a DNS issue
You're right I have not explained this properly. These are IPs of the docker containers in the bridge network.
Actually now that I think about it, both NPM and portainer (which properly work) have exposed ports, while the other two don't
I did that because when I connected with
/nc, the stuff the service needed to address its pages was just appended so NPM didn't recognise the location anymore.Something like
/nc->/ncindex.htmlAlso it works because communication exists, but something goes wrong in resource transfer
@albio46 commented on GitHub (Nov 28, 2022):
Tried exposing ports but nothing changed.
I've dwelved a little bit deeper in nginx configuration code and i've noticed that adding
add_header Content-Security-Policy upgrade-insecure-requests;to the location configuration turns the error into this:Uncaught (in promise) TypeError: Failed to fetch dynamically imported module:Not sure this is relevant or expected, don't know what i'm doing
@github-actions[bot] commented on GitHub (Feb 3, 2024):
Issue is now considered stale. If you want to keep it open, please comment 👍
@jeremysherriff commented on GitHub (Nov 8, 2024):
This issue has suddenly started to affect me, although I am not sure of what the trigger was. Maybe a Chrome update, but my research indicates that strict MIME type checking has been in place for a long time.
All .css and .js files are transferring as text/html, but when I access the same (internal) sites without going through NPM then the content type is set correctly. My reasearch indicates that this can happen if the
include mime.typesdirective is missing or the mime.types file is corrupt or missing entries. I am unsure how to check the full nginx config when using NPM.Edit: I have found the mime.types file, confirmed the content and that it is being included in the nginx configuration correctly (
nginx -Tfrom inside the docker container),@jc21
The issue ONLY occurs with subfolder/"location" blocks, if I create a new proxy host with the same configuration in the root server block then all content is given the correct content-type. Does that provide any context to help resolve these two open issues?
@github-actions[bot] commented on GitHub (Jun 14, 2025):
Issue is now considered stale. If you want to keep it open, please comment 👍
@nkay08 commented on GitHub (Jul 27, 2025):
I have got the same issue.
I use NPM as reverse proxy to a dockerized webserver (nginx again). If I access my site without NPM, everything is correct. But if I access it through NPM, then my static files are transferred with the wrong content type.
@github-actions[bot] commented on GitHub (Feb 19, 2026):
Issue is now considered stale. If you want to keep it open, please comment 👍
@jeremysherriff commented on GitHub (Feb 19, 2026):
This issue is the reason I moved away from NPM. The fact that it remains open after so long simply underscores that it was the right move.