Different web server on one domain

I have two web sites:

  • (a) is built with yesod web framework (and running on port A)
  • (b) is built with wordpress (and running on port B)

I want to publish these sites as following:

Read More
  • foo.com/wp refers to (b)
  • Other pages on foo.com refers to (a)

Is it possible?

Related posts

Leave a Reply

1 comment

  1. You can use (a) and (b) behind a proxy (c) — NGINX is my personal preferred server for that purpose because it is insanely fast and good on resources.

    http://nginx.org/en/docs/beginners_guide.html#proxy

    You’d do something like this:

    server {
        location / {
            proxy_pass http://localhost:{port for a}/;
        }
    
        location /wp {
            proxy_pass http://localhost:{port for b}/;
        }
    }
    

    ** note that {b} will know that it is at /wp. If you need the backend server to think that it’s at root (/), you can do it with a rewrite (also in the NGINX docs)