nginx 설치
curl https://nginx.org/download/nginx-1.19.1.tar.gz | tar xz
cd nginx-1.19.1 && ./configure --prefix=/usr/local/nginx --with-http_ssl_module
make && make install
reverse proxy 및 SSL offload 설정
cd /usr/local/nginx
경로로 이동해서 vim conf/airflow.conf
설정파일을 다음과 같이 만들어준다.
events {
use epoll;
multi_accept on;
worker_connections 4096;
}
http {
server {
listen 80;
server_name airflow.centos.vm.oboki.net;
root html;
location / {
return 301 https://airflow.centos.vm.oboki.net$request_uri;
}
}
server {
listen 443 ssl;
server_name airflow.centos.vm.oboki.net
root html;
ssl_certificate /usr/local/cert/airflow.centos.vm.oboki.net.crt;
ssl_certificate_key /usr/local/cert/airflow.centos.vm.oboki.net.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location ~ /\.ht {
deny all;
}
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
}
nginx 실행
sbin/nginx -c ./conf/airflow.conf -p .