Test your origin
Complete these steps to test your Linode origin server.
Create test pages
You can use a static or dynamic page to test your Linode origin servers.
-
To test using dynamic pages, create a page for each of your origin servers. It should show a unique characteristic of the origin servers, such as the server IP address or hostname.
For example, if you used Node.js Marketplace App to create your Linode, you can edit the
/opt/nodejs/hello.js
file for each backend Linode and restart Node.js:
const http = require('http');
const hostname = 'localhost';
const port = 3000;
const os = require('os');
//Add the following line:
const servername = os.hostname();
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/html');
//Update the following line as shown below:
res.end('Hello World @'+servername);
});
server.listen(port, hostname, () => {
console.log();
});
- To test using a static page, create a unique html page for each of your Linode origin servers. The pages can simply include text to help you identify each of the origin servers. For example,
server1
andserver2
.
<!DOCTYPE html>
<html>
<head>
<title>server1</title>
</head>
<body>
Welcome to server1!
</body>
</html>
<!DOCTYPE html>
<head>
<title>server2</title>
</head>
<body>
Welcome to server2!
</body>
</html>
Test session stickiness
-
Open the test page URL using a web browser that supports HTTP cookies. For example, if you have the Node.js test page above and your website hostname is
origin-0361ece-www.test.com
, your test page URL ishttps://origin-0361ece-www.test.com/
. -
Reload the page a few times. You should receive all responses from the same origin server.
-
Open a new browser window in private/incognito mode or delete your web browser cookies and test again.
-
Repeat step 2, until you see a new response coming from a different origin server.
Test failover
-
To test failover,shut down one of your origin servers by selecting Power Off for the desired Linode.
-
Repeat the steps in Test Session Stickiness. You should only get a response from active origin servers.
For more information on testing options, refer to the Ion documentation.
Updated 5 months ago