Serve multiple sites with SimpleHTTP?

Linode Staff

Hi,

I have two domains associated with my Linode VPS and I want them to redirect to different sub-directories of my main IP, so as to serve different webpages when visiting the different domains. How can i do that?

Thanks

1 Reply

Hey there!

I ran a curl against your IP (omitted for security's sake):

$ curl -IL <ip omitted>
HTTP/1.0 200 OK
Server: SimpleHTTP/0.6 Python/2.7.13
Date: Thu, 17 May 2018 20:22:32 GMT
Content-type: text/html
Content-Length: 12231
Last-Modified: Thu, 17 May 2018 19:44:47 GMT

and based on the output, I'm not 100% sure what software your site is hosted with (it looks like it's Python based?), but I do know that this is reasonably simple to configure using Nginx's Server Block feature. I have attached our list of Nginx guides to help get you started.

I'm also including a direct link to the Add Basic Site section in our guide on Nginx with Ubutnu 18.04, which contains an example Server Block configuration file. The guide itself is specific to Ubuntu 18.04, but Nginx is configured pretty much the same on all distributions, just pay attention to specific file paths, etc in case they vary in your setup from what the guide recommends. You just want to create separate entries to re-direct requests for each domain to the correct document root (the folder in which your site's code lives). Once this is configured, you should be up and running with both domains in no time!

Regards,
Tom D.
Linode Support Team

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct