반응형

yona를 playframework 단독으로 사용하고 있었는데 nginx와의 연동 및 https 적용을 위해서 찾아보던 중

nginx의 reverse proxy를 이용하여 서비스 제공을 할 수 있다고 하여 찾아보기 시작

 

reverse proxy에 대해 잘 설명해 놓은 블로그

https://akal.co.kr/?p=1781

https://whatisthenext.tistory.com/123

 

여기서 중요한 점은 proxy_pass http://서버ip:9000/; 으로 nginx 서버에 / 요청이 오면 proxy_pass에 설정된 정보로 

 호출하여 전달한다는 것이다.

 

 

 

- 최종적으로 설정한 정보

        server {
                listen 80;
                server_name 서버ip;

                return 301 $scheme://서버domain$request_uri;

        }



        server {
                listen 443;
                server_name 서버domain;

                ssl     on;
                ssl_certificate         /root/security/ssl/cert.pem;
                ssl_certificate_key     /root/security/ssl/key.pem;
                ssl_session_timeout     20m;
                ssl_protocols  TLSv2 TLSv3;
                ssl_ciphers  HIGH:!aNULL:!MD5;
                ssl_prefer_server_ciphers   on;

                location / {
                        #proxy_redirect off;
                        proxy_buffering off;
                        #proxy_pass_header Server;
                        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_pass http://서버ip:9000/;
                        #proxy_redirect http://서버ip:9000 https://서버도메인;
                        proxy_http_version 1.1;
                 }


        }

 

 

- nginx에서 jenkins와 reverse proxy로 연결하는 방법

https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-with-ssl-as-a-reverse-proxy-for-jenkins

- nginx에서 ssl 적용하는 방법

https://www.lesstif.com/pages/viewpage.action?pageId=27984443

- nginx에서 http요청인 경우 https로 redirect 시키는 방법

https://serverfault.com/questions/629045/nginx-redirect-ip-address-to-domain-name/629153

- yona에서 proxy 적용관련 참고

https://repo.yona.io/yona-projects/yona-help/post/5

반응형
반응형

출처: https://graphql.org/learn/

 

 

 

반응형
반응형

nodejs 4.2.6 / npm 3.5.2 를 사용하다가 jupyterhub를 설치하고 나서 

실행하려고 할때 에러가 발생하면서 


[I 2018-11-27 15:15:26.804 JupyterHub proxy:567] Starting proxy @ http://:8000
/usr/local/lib/node_modules/configurable-http-proxy/node_modules/winston/lib/winston.js:11
const { warn } = require('./winston/common');


실제로 서버 실행이 되지 않았다.


추후에 알고 보니 nodejs인지 npm인지 정확하게는 모르겠지만, 

버전이 낮아서 발생하는 문제로 판단되어


nodejs를 지우고 최신으로 설치 작업을 진행


sudo apt-get purge --auto-remove nodejs



sudo apt-get install curl


curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -


sudo apt-get install nodejs

nodejs -v


sudo apt-get install npm

npm -v



맨처음 npm 명령을 쳤을 때 /usr/local/bin/npm 에서 계속 찾기 때문에 정상적으로 실행이 되지 않아서, 설치가 제대로 되지 않았다고 판단했다.


하지만 곰곰이 생각해보니 /usr/bin/npm에서는 명령이 정상적으로 동작하는 게 아니겠는갓!


그래서 ln -sf /usr/bin/npm /usr/local/bin/npm으로 바라보는 링크를 연결해주었더니

정상적으로 실행이 되었다.



기타)


jupyterhub에서 사용하는 configurable-http-proxy

https://www.npmjs.com/package/configurable-http-proxy#install


https://jupyterhub.readthedocs.io/en/0.7.2/getting-started.html


반응형

+ Recent posts