开发者

Is there a way to have nginx route ssl requests to 443 to two different apps?

开发者 https://www.devze.com 2023-04-13 04:06 出处:网络
I need to set up nginx so that requests via SSL to port 443 are routed to Rails Application A or Application B (say a PHP app) depending on the request path. Is this even possible to 开发者_JS百科conf

I need to set up nginx so that requests via SSL to port 443 are routed to Rails Application A or Application B (say a PHP app) depending on the request path. Is this even possible to 开发者_JS百科configure?


Yes, it is possible and depends on how is your backend applications handled. You need to use location to match request path and route request to appropriate backend with proxy_pass, fastcgi_pass etc.

Example:

server {
  listen               443;
  ssl                  on;

  location /appa/ {
    proxy_pass http://appa_backend/;
  }

  location /appb/ {
    proxy_pass http://appb_backend/;
  }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消