월: 2017 7월

ESXi를 synology reverse proxy로 접속하기

https://github.com/orobardet/dsm-reverse-proxy-websocket

websocket 통신을 할 수 있게 수정

/usr/syno/share/nginx/Portal.mustache 파일 Bold 표시 추가

{{#ReverseProxy}}
server {
listen {{port}}{{#https}} ssl{{/https}}{{#https.http2}} http2{{/https.http2}}{{#reuseport}} reuseport{{/reuseport}};
listen [::]:{{port}}{{#https}} ssl{{/https}}{{#https.http2}} http2{{/https.http2}}{{#reuseport}} reuseport{{/reuseport}};
{{#resolver}}
resolver {{resolver}};
set $backend “{{backend}}”;
{{/resolver}}
{{#fqdn}}
server_name {{fqdn}};
{{/fqdn}}
{{#https.certificate}}
ssl_certificate {{https.certificate}};
{{/https.certificate}}
{{#https.key}}
ssl_certificate_key {{https.key}};
{{/https.key}}
{{#https.hsts}}
{{> /usr/syno/share/nginx/HSTS}}
{{/https.hsts}}
location / {
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;
proxy_intercept_errors  on;
proxy_http_version      1.1;
            proxy_set_header Upgrade $http_upgrade;
              proxy_set_header Connection “upgrade”;
              proxy_read_timeout 86400;
{{#resolver}}
proxy_pass $backend;
{{/resolver}}
{{^resolver}}
proxy_pass {{backend}};
{{/resolver}}
}}{{/ReverseProxy}}

sudo synoservicecfg –restart nginx
로 재시작

HSTS 켜도 443으로 자동 리다이렉트 안될때, 80 포트로 접속했을때 443으로 자동 리다이렉트(6.1.6-15266 에서 해결됨)

 

Advertisements