Nginx如何将SSL加密的数据传递到Rails应用程序? [英] How does Nginx pass SSL encrypted data to a Rails app?

查看:60
本文介绍了Nginx如何将SSL加密的数据传递到Rails应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个使用Unicorn运行Rails应用程序并使用Nginx作为反向代理的设置.当Nginx配置为处理SSL时,是否意味着它会将加密的数据直接保持不变地直接传递到我的Rails应用程序,还是将其解密然后将其发送到我的Rails应用程序,以便我的Rails应用程序看到未加密的数据?

Suppose I have a setup running my Rails app with Unicorn and using Nginx as the reverse proxy. When Nginx is configured to handle SSL does that mean it passes the encrypted data to my Rails app directly unchanged or does it decrypt it and then send that to my Rails app, so that my Rails app sees unencrypted data?

推荐答案

这称为nginx ssl终止.数据已经被nginx解密,并且上游的rails应用程序只需要处理未加密的数据,即您的rails应用程序应该只监听端口80(http),并且在反向代理设置中,您应该拥有

That's called nginx ssl termination. The data is already decrypted by nginx and the upstream rails app just need to deal with unencrypted data, i.e., you rails app should just listen to port 80 (http) and in your reverse proxy setup, you should have

proxy_pass http://rails_app_domain;

proxy_pass https://rails_app_domain;

这篇关于Nginx如何将SSL加密的数据传递到Rails应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆