As for real-time deployment, a very simple (and quick) setup is if you allow the web server with static content and let the Plack application work with dynamic content. This usually requires at least 2 proxies in your web server configuration. Proxy A for your static files (provided that they are all in one place) and proxy B to the port on which your Plack application is deployed.
For example, part of the nginx configuration might look like this. Suppose that the Plack application runs locally on port 5001 and your static files are available under the URL http://mydomainname.com/static
server {
listen 80;
server_name mydomainname.com;
location / {
proxy_pass http://localhost:5001/;
proxy_redirect 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;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Host $host;
}
location /static {
root /path/to/static/files;
}
}
source
share