반응형
아파치에서도 reverse proxy를 구성할 수 있다. 간단하게 몇몇 설정만 수정하면 사용할 수 있으니 유용하다
sudo apt install apache2
/etc/apache2/sites-available/000-default.conf 수정
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyRequests Off
ProxyVia Off
<Proxy *>
Require all granted
</Proxy>
ProxyPass / http://<접속할서버>:<포트>/
ProxyPassReverse / http://<접속할서버>:<포트>/
...........................
proxy 모듈을 자동으로 enable 했던것 같은데 혹시 안되면 proxy module을 enable해주면 된다.
a2enmod proxy
a2enmod proxy_http
a2enmod proxy_ajp
a2enmod rewrite
a2enmod deflate
a2enmod headers
a2enmod proxy_balancer
a2enmod proxy_connect
a2enmod proxy_html
반응형