Note: “VirtualHost” is an Apache term. NGINX does not have Virtual hosts, it has “Server Blocks”. (https://www.nginx.com/resources/wiki/start/topics/examples/server_blocks/).
I know about ip-based and name-based server blocks, but is it possible to have URL-based server blocks? In other words, I want http://example.com/foo
and http://example.com/bar
to be served from completely independent roots. This would be a trivial problem to solve with name-based server blocks if the names were different http://example1.com
and http://example2.com
, but since the names are the same (example.com
) and only the path part of the URL is different... Can nginx support separate server blocks for these types of URL's?