Is there a way to have nginx route ssl requests to 443 to two different apps?
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/;
}
}
精彩评论