Nginx支持https转发
1.配置
location /api/ {
proxy_pass https://uat-trans-safe.jd.com/;
}
2.如何生效呢
重新编译nginx,带上参数
--with-http_ssl_module
举个例子
./configure --prefix=/export/servers/nginx --sbin-path=/export/servers/nginx/sbin/nginx --conf-path=/export/servers/nginx/conf/nginx.conf --error-log-path=/export/servers/nginx/logs/error.log --http-log-path=/export/servers/nginx/logs/access.log --pid-path=/export/servers/nginx/var/nginx.pid --lock-path=/export/servers/nginx/var/nginx.lock --http-client-body-temp-path=/dev/shm/nginx_temp/client_body --http-proxy-temp-path=/dev/shm/nginx_temp/proxy --http-fastcgi-temp-path=/dev/shm/nginx_temp/fastcgi --user=admin --group=admin --with-cpu-opt=pentium4F --without-select_module --without-poll_module --with-http_realip_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --without-http_userid_module --without-http_userid_module --without-http_geo_module --without-http_map_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --add-module=/usr/local/src/ngx-tomcat/agentzh-chunkin-nginx-module-51c84e4 --with-pcre=../pcre-8.31 --with-http_ssl_module
make
makeinstall
然后重启nginx
原创:做时间的朋友