1

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:

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

Is it possible?

1 Answer 1

4

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)

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.