Setup VPS for Linux Noobs!




new password?
login
X
nginx rewrite image

This how-to guide shows the syntax to point a site or blog to another domain. That way, for instance, traffic from a passive site benefits an active one.

While the purpose may be different, this is the same code used in Part 12 – *USEFULLY* Park A Spare Domain with Nginx.

Open up or create your website’s virtual host configuration file:-

Setup Unmanaged VPS: The Ubuntu-Nginx Guide

Take your virtual private server from zero to hero

  .. from blank box to cute-as server ..  

with this easy-to-follow copy/paste guide.

22+ parts with video, here’s the index.


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

If the redirect is the only purpose for the site, delete or comment out anything else, and add this:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Nginx Rewrite Rule

  • server { opens up the server block
  • listen 80; tells the server to listen on the default port 80
  • server_name www.mydomain.org mydomain.org; this says to listen out for calls to this site, whether including the www prefix or not
  • rewrite ^/(.*) http://www.anotherDomain.com/$1 permanent; tells Nginx to redirect any such calls to this secondary website
  • } just closes the server block

Thassit.

Setup Unmanaged VPS: The Ubuntu-Nginx Guide

Take your virtual private server from zero to hero

with this easy-to-follow copy/paste guide.

“My local PC runs Windows” Show me for Linux/Mac

22+ parts with video, here’s the index ..

Manage Unmanaged VPS: Ubuntu-Nginx Administration

Already set it up? We’d best maintain it then.

Toggle to the ..  Ubuntu-Nginx Admin Index

Manage Unmanaged VPS: Ubuntu-Nginx Administration

Maintain your virtual private server with ..

.. cheatsheets, tutorials, tips & guides.

Head back to the ..  Ubuntu-Nginx Installation Index

Nginx Admin: In the Works ..

This lot’s marked for addition already:-

  • Setup or Edit DNS using Bind
  • Network Tools Troubleshooting Guide
  • The Comprehensive Permissions Guide
  • Configuring Nginx Rewrites
  • Custom Website Error Page
  • Setting up Cron Jobs
  • Rsync for Incremental Remote-to-Local Backup
  • Cron & Rsync for Automatic Backup
  • Cron & mysqldump for Auto DB Backup
  • Safeguard Bandwidth with Hotlink Protection
  • Block Access with Nginx’ IP Deny



Got a Question? Want to Comment?

This site has no comments system. We've got a better system!

Please use the link at the top of the post and goto this topic's forum thread:-

  • to help build community
  • for a superior knowledge base
  • to keep info in one place, not diluted between forum & comments.

For those posts ported from Guvnr.com (pre-Feb/2010), archive comments remain.

Handy info from these comments is in the process of being ported to the forum and attributed to the original author.

If you think this idea sucks, let me know.

Thank you.

  • George November 15th, 2009 at 4:26 pm

    Hi Guv, Your guides have been a god send. Thank you.

    I need some advice mate, Have you done domain mapping on WPMU? I am on linode and cant get it to work, or more like i dont know how to make it work. The guys are linode arent much help coz it is an unmanaged solution.

    I have gotten as far creating a zone for the domain and adding the records in sites-enabled folder for the domain. In the settings the domain is pointing to the root of the wpmudomain.

    but the domain redirects to the create new blog signup page when that happens.

    any experience with this?

    help would be tremendously appreciated. been googling this for two days now..
    I have