나는 Nginx 리버스 프록시 뒤에 Docker 내부에서 Jenkins를 실행 중입니다. 이제 해결사에게 문제가 생겼습니다.Jginkins with Nginx 역방향 프록시 및 리졸버
내가 함께 리졸버를 활성화 할 때 :
set $backend "http://jenkins:8080/";
proxy_pass $backend;
나는 모든 자바 스크립트 파일에 대한 다음과 같은 오류를 얻을 것이다 :
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.
을 언제 해결하지 않고 단순히 프록시 패스 :
proxy_pass http://jenkins:8080/;
해석자가 없어도 작동합니다. 리졸버는 필수입니다. 그렇지 않으면 호스트 jenkins
이 Ip (Docker DNS Server)를 변경할 때 설치가 작동하지 않습니다.
내 구성 : 자바 스크립트 대신에 HTML 페이지를 받고있는 것처럼 나타나는 오류 메시지를 기반으로
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;
}
}
좋은 질문! :-) – cnst
upvote, accept, award 감사합니다; btw, 장래에는 장래 탭에서 질문이 사라 지므로 수동 "상"부분을 잡고 싶을 수 있습니다. 따라서 다른 사람들은 노트를 작성하고 투표 할 수 없습니다. – cnst