Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>That's not possible with play alone, since each application runs in its own process and there can only be one process listening on one port at one time. What you can do is run your play applications on ports 9001 and 9002 and then run a server like nginx on port 9000 and configure it to route requests for the different URLs to your play applications.</p> <p>See this example: <a href="http://www.cyberciti.biz/tips/using-nginx-as-reverse-proxy.html" rel="nofollow">http://www.cyberciti.biz/tips/using-nginx-as-reverse-proxy.html</a> The only difference to your case is that you would have one <code>server {...}</code> block with two <code>location</code> blocks in it. It would look something like:</p> <pre><code>upstream play1 { server localhost:9001; } upstream play2 { server localhost:9002; } server { listen localhost:9000; server_name www.example.com; access_log /var/log/nginx/log/www.example.access.log main; error_log /var/log/nginx/log/www.example.error.log; root /usr/share/nginx/html; index index.html index.htm; ## send requests to play1 ## location /Project1/ { proxy_pass http://play1; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_redirect off; proxy_buffering off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } ## send requests to play2 ## location /Project2/ { proxy_pass http://play2; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_redirect off; proxy_buffering off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload