'포트별 도메인'에 해당되는 글 1건

  1. 2018.01.29 도메인 여러개 포트별로 설정해주기
2018. 1. 29. 13:56



가상호스트에서 도메인별로 80번 들어오는거 분배는 했었는데,


가끔 이 도메인으로 들어오면, 다른 포트로 보내주고 싶을때가 있다.


버츄얼호스트 세팅법은 다른 포스팅에 올리겠다.


여기서는 포트포워딩하는거다.


도커에서나, 기타 다른 포트를 사용하는 웹서버를 돌려 주고 싶을때, 


#> vi /etc/httpd/conf/httpd.conf

로 들어가서,


버츄얼 호스트에 

ProxyPass, ProxyPassReverse 를 써주면 된다.

ProxyPass 들어오는주소 원하는주소포트  적어주면 된다.


ProxyPass / http://localhost:3000/


 / 루트로 들어오는거 http://localhost:3000/ 이렇게 보내라는 이야기이다.


사실 여기서 DocumentRoot는 의미없다.


ServerName에 내가 사용원하는 도메인 적어주면 된다.




<VirtualHost *:80>

    ServerAdmin test@gmail.com

    DocumentRoot /var/www/html/

    ServerName test.com

    ProxyPass / http://localhost:3000/

    ProxyPassReverse / http://localhost:3000/

    ErrorLog "logs/error_log"

    CustomLog "logs/access_log" common

</VirtualHost>




참고 블로그 : http://tear230.blog.me/220282531649

Posted by Tyson