Welcome! Log In Create A New Profile

Advanced

Re: nginx tips for localhost development

Francis Daly
April 15, 2013 01:50PM
On Sun, Apr 14, 2013 at 10:50:15PM -0400, Ian M. Evans wrote:

Hi there,

> I've realized that it would probably be wise to develop locally by running
> a localhost server in a linux VM on my laptop and desktop.
>
> Can anyone give me any tips (or point me to a tutorial/article) that would
> show me how to set up nginx for localhost testing? Is it possible for me
> to create a setup in nginx so both www.example.com and
> www.mynewsiteexample.com would be served by the localhost nginx?

On the nginx side, there should be approximately nothing special to do.

The nginx.conf that works on your production server can be put onto your
development server; "listen" directives which specify ip addresses may
need to be changed, and file names may need to be changed if you have
a different layout.

But other than that, not much about nginx cares.

The main thing you will need, if you use multiple server{} blocks with
different server_name directives, is to make sure that whatever client
you are testing with (== web browser) resolves the names that you use
to be an address that your test nginx listens on. /etc/hosts is probably
the simplest way to arrange that.

If you're comfortable testing using "curl", you don't even need that --
just add a suitable "-H Host:" argument to each command.

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx tips for localhost development

Ian M. Evans April 14, 2013 10:52PM

Re: nginx tips for localhost development

mex April 15, 2013 09:16AM

Re: nginx tips for localhost development

Francis Daly April 15, 2013 01:50PM

Re: nginx tips for localhost development

Ian M. Evans April 23, 2013 02:12AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 260
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready