简体   繁体   English

Nginx如何将SSL加密的数据传递到Rails应用程序?

[英]How does Nginx pass SSL encrypted data to a Rails app?

Suppose I have a setup running my Rails app with Unicorn and using Nginx as the reverse proxy. 假设我有一个使用Unicorn运行Rails应用程序并使用Nginx作为反向代理的设置。 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时,是否意味着它会将加密的数据直接保持不变地直接传递到我的Rails应用程序,还是将其解密然后将其发送到我的Rails应用程序,以便我的Rails应用程序看到未加密的数据?

That's called nginx ssl termination. 这就是所谓的Nginx SSL终止。 The data is already decrypted by nginx and the upstream rails app just need to deal with unencrypted data, ie, you rails app should just listen to port 80 (http) and in your reverse proxy setup, you should have 数据已经被nginx解密,上游rails应用程序只需要处理未加密的数据,即,rails应用程序应该只监听端口80(http),并且在反向代理设置中,您应该

proxy_pass http://rails_app_domain;

NOT

proxy_pass https://rails_app_domain;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM