I am running Jenkins inside Docker behind an Nginx reverse proxy. Now I got a problem with the resolver.
When I activate the resolver with:
set $backend "http://jenkins:8080/";
proxy_pass $backend;
I will get the following error for all javascript files:
Refused to execute script from 'http://localhost/static/....js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
When I simply proxy pass without resolver:
proxy_pass http://jenkins:8080/;
It works but without resolver. The resolver is mandatory otherwise the setup won't work when the host jenkins
changes it's Ip (Docker DNS Server).
My configuration:
resolver 127.0.0.11 ipv6=off valid=30s;
client_max_body_size 100m;
keepalive_timeout 65;
types_hash_max_size 2048;
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
location / {
set $backend "http://jenkins:8080/";
proxy_pass $backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}