June 22, 2018
역방향 proxy 필요
현재 진행 사항 서브 도메인 : https://bbb.aaa.com:port까지 성공 인증서 미해결
https://bbb.aaa.com 으로 연결하는 것이 목표
리버스 프록시 (reverrse proxy) 가 필요한 상황
현재 가상호스트 사용하고 있으나 개념 확실히 모름.
https://www.joinc.co.kr/w/man/12/proxy http://akal.co.kr/?p=1173
위 블로그에서 리버스프록시 개념 알게됨 1. 현재 웹서버(nginx) 개방포트 80, 443, 22등 많이 사용하고 있음
nginx 설정에서 뭔가가 필요
현재 문제점
https://bbb.aaa.com:port : 헤놀로지 정상 진입
https://bbb.aaa.com : 운영중인 도메인 중 한개로 진입
nginx /etc/nginx/conf.d/default.conf 에서 무언가 조치 필요.
-> 헤놀로지 내부 아이피:port로 바로 보내주면 될 것 같은 느낌.
진행사항 1. 헤놀로지 ddns
dnszi.com
시놀로지 : 스케줄링 weget:
2018.06.24 update : 시놀로지에서 DDNS 안함.
프록시 서버 ( ubuntu) 에서 해결
$adduser nas
2. 인증서 발급
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /root/ssl/localhost.key -out /root/ssl/localhost.crt
server { listen 443 default_server; server_name localhost;
ssl\_certificate "/root/ssl/localhost.crt";
ssl\_certificate\_key "/root/ssl/localhost.key";
ssl\_ciphers 'PSK';
return 444;
}
server { listen 80; server_name bbb.aaa.com;
return 301 https://server\_name;
}
server {
listen 443 ssl http2;
server\_name bbb.aaa.com;
location / {
proxy\_redirect off;
proxy\_pass\_header Server;
proxy\_set\_header Host $http\_host;
proxy\_set\_header X-Real-IP $remote\_addr;
proxy\_set\_header X-Scheme $scheme;
proxy\_pass http://000.000.000.000/;
}
실패 : 리버스 프록시가 구성되어야 443, 80이 헤놀로지에 연결되어 시도할수 있을것 같음.
헤놀로지에서는 하지 않고 프록시서버에서 받아야 할것 같음.
letsencrypt certonly —webroot —webroot-path=/home/bbb/www -d bbb.aaa.com
nginx /etc/nginx/conf.d/default.conf 수정
현재 https://bbb.aaa.com 으로 접속하면
https://bbb.aaa.com:port로 변경되어 접속까지 성공
// TODO : 1 . SSL 2. bbb.aaa.com:port 에서 :port 제거
TO BE 컨티뉴…