apache proxypass 할때 api 만들때, https get, post다 받으려면 그냥 RewriteRule 쓰세요!~~
안녕하세요 여러분 크리에이트 메이커입니다.
오늘도 좋은 정보를 공유하고자글을쓰네요.
외주의뢰를 하면서 api작업의뢰를 맡았는데, 왠걸.. 서버가 https 네요..게다가 아파치...
그래서 proxypass, proxyrevers, proxymatch 을쓰면서 get과 post를 받기위해 애를썻는데요.. 결국 다 안되더군요,,
그래서 문서읽고 연구하고 찾은게 RewriteRule 입니다.
사실 80포트 http로 하면 proxypass, proxyrevers, proxymatch 로 get, post다 되는데, https로 하니까 안되더라구요.
요약 하면
<VirtualHost *:443>
ServerName library.ioneis.com:443
RewriteEngine on
ProxyRequests Off
SSLProxyEngine on
ProxyPreserveHost On
AllowEncodedSlashes NoDecode
SSLEngine on
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
SSLCertificateFile crt경로
SSLCertificateKeyFile 키경로
SSLCertificateChainFile 체인경로
RewriteRule /api/ar/location https://경로?userSeq=12
RewriteRule ...
더 추가할 API잇으면 이렇게 쭉 넣으세요.
</VitualHost>
하면 get, post다 받을 수 있씁니다.
사실 get이 안되던 이유는 저기 경로에 ? 가 들어가면 apache는 인식을 못하는 버전이 있는거 같아서요.
그래서 ? 때문에 get인식이 안되더라구요..근데 RewriteRule을 이요하니 다 되네요!!
혹시 저처럼 다 안되는 분들은 참고해보세요~
그럼 즐거운 개발되세요!!