2017-10-30 1 views
0

SSL을 사용하는 nginx의 역방향 프록시를 설정하려고합니다. Nginx에는 SSL 인증서와 키가 있습니다. 백엔드 서버는 Nginx와 SSL을 말하지 않습니다 (DMZ 로컬 네트워크 설정이므로 괜찮습니다).역방향 프록시 nginx 해당 파일 또는 디렉토리가 없습니다.

내 문제는 : 프록시 패스가 발생하면 오류 로그에 많은 '해당 파일이나 디렉토리가 없습니다'라는 메시지가 표시됩니다. 백엔드 응용 프로그램의 404 오류 페이지로 이동합니다. * 9 공개() "/etc/nginx/html/scripts/msptagutils.js는"실패 (2 : 2052이

2052 # :


오류 라인의 일부를없는 그런 파일 또는 디렉토리), 클라이언트 : 189.68.143.17, 서버 : www.example.com.br, 요청 : "GET /scripts/msptagutils.js?build=9301 HTTP/1.1", 호스트 : www.example.com.br, 참조 페이지 : 2052이 https://www.example.com.br/servicedesk/

2052 # * 9 공개() "/etc/nginx/html/style/sdmspstyle.css는"실패 (2 : 해당 파일이나 디렉토리) 클라이언트 : 189.68.143.17, 서버 : WWW .example.com.br, 요청 : "GET/style/sd mspstyle.css? build = 9301 HTTP/1.1 ", 호스트 : www.example.com.br, 참조 자 : https://www.example.com.br/servicedesk/

2052 # 2052 : * 1 open()"/ etc/nginx/html/ze/css/회색/ze.min.css "실패 (2 : 해당 파일 또는 디렉토리 없음), 클라이언트 : 189.68.143.17, 서버 : www.example.com.br, 요청 :"GET /ze/css/gray/ze.min. CSS는 HTTP/1.1 ", 호스트 :"www.example.com.br ", 참조 자"https://www.example.com.br/servicedesk/는 "


는 servicedesk.conf 파일입니다

server { 
    ### server port and name ### 
    listen   443; 
    ssl    on; 
    server_name  www.example.com.br; 

    ### SSL log files ### 
    access_log  /var/log/nginx/servicedesk-ssl-access.log; 
    error_log  /var/log/nginx/servicedesk-ssl-error.log; 

    ### SSL cert files ### 
    ssl_certificate  /etc/nginx/ssl/www.example.com.br-chained.crt; 
    ssl_certificate_key /etc/nginx/ssl/example.com.br.key; 

    ### Add SSL specific settings here ### 


    ssl_protocols  SSLv3 TLSv1 TLSv1.1 TLSv1.2; 
    ssl_ciphers RC4:HIGH:!aNULL:!MD5; 
    ssl_prefer_server_ciphers on; 
    keepalive_timeout 60; 
    ssl_session_cache shared:SSL:10m; 
    ssl_session_timeout 10m; 

    ### We want full access to SSL via backend ### 
    location /servicedesk { 
      proxy_pass http://servicedesk-site.example.local; 

      ### force timeouts if one of backend is died ## 
      proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; 



      ### Set headers #### 
      proxy_set_header  Accept-Encoding ""; 
      proxy_set_header  Host   $host; 
      proxy_set_header  X-Real-IP  $remote_addr; 
      proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for; 

      ### Most PHP, Python, Rails, Java App can use this header ### 
      #proxy_set_header X-Forwarded-Proto https;## 
      #This is better## 
      proxy_set_header  X-Forwarded-Proto $scheme; 
      add_header    Front-End-Https on; 


      ### By default we don't want to redirect it #### 
      proxy_redirect  off; 
    } 

}


내게 방향을 가르쳐 줄 수 있습니까? 내가 뭘 잘못하고있어?

답변

0

경로 /servicedesk에 대한 프록시 요청 인 것 같습니다.

로그에 로컬로 확인하려고 시도하는 /scripts/msptagutils.js에 대한 액세스가 표시됩니다. nginx가 SSL 오프 로딩 만하는 경우 해당 요청은 백엔드로 전달되어야합니다. 따라서 전체 경로를 프록시로 지정하십시오. /

server { 
    ... 
    location/{ 
     prox_pass ... 
    } 
} 
관련 문제