GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Toadfarm::Manual::VirtualHost(3) User Contributed Perl Documentation Toadfarm::Manual::VirtualHost(3)

Toadfarm::Manual::VirtualHost - Virtual host setup

This is an alternative to using "nginx" (or another web server) in front as virtual host router.

This is especially useful if already have a CDN (like <http://cloudflare.com>) in front.

The magic part here is the "Host" HTTP header which is sent by the browser, and will route to the correct application.

  #!/usr/bin/perl
  use Toadfarm -init;

  mount "/home/www/project1/script/app1" => {
    Host => "example.com",
  };

  mount "/home/www/project2/script/app2" => {
    Host => "your-other-domain.com",
  };

  start ["http://*:8080"], workers => 8;

Note: Defining a default app might be an idea, in case the a browser doesn't set the "Host" header.

<http://en.wikipedia.org/wiki/Virtual_host>

Jan Henning Thorsen - "jhthorsen@cpan.org"
2015-10-01 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.