advice sought- using 1 domain on DEV, 2 domains on PRODUCTION

10 views
Skip to first unread message

Jonathan Vanasco

unread,
Jul 30, 2015, 3:48:20 PM7/30/15
to pylons-discuss
We have a need build out a small "developer" site that will live on `developers.domain.com`

The current idea to implement is this:

1. Serve off of a route that is "/developers/"
2. Write all html as if we're on "developers.domain.com"
4. In dev: use a tween to regex "developers.domain.com" urls onto  `domain.com/developers/`

Can anyone offer other ideas?  We'd like to avoid functions for generating urls as-needed, because there are a lot of URLS at play (documentation cross references, etc).

Vincent Catalano

unread,
Jul 30, 2015, 11:03:33 PM7/30/15
to pylons-...@googlegroups.com

Have you considered handling this using Nginx or Apache?

--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To post to this group, send email to pylons-...@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Iain Duncan

unread,
Jul 31, 2015, 11:29:03 AM7/31/15
to pylons-...@googlegroups.com
My personal experience has been that this sort of thing is much easier to manage from apache with mod_proxy and mod_rewrite, but YMMV. I've had fewer headaches keeping my inner-apps as URL agnostic and ignorant as possible, they only know about their paths, from the mount point on.. If it were me, I'd use mod_proxy (or an nginx equiv) and perhaps some wsgi middleware so that if the apps need to know more they can grab it off the wsgi env and at least any URL specific code is bound up in one place only (the wsgi middleware). Much easier when you change your mind, or add more, or have to change how deployment works. 

my two cents Canadian!
iain

Jonathan Vanasco

unread,
Jul 31, 2015, 11:57:28 AM7/31/15
to pylons-discuss, jvan...@gmail.com
Sorry, to be more clear:

My idea is have nginx rewrite `developers.domain.com/PATH` onto `domain.com/developers/PATH` , and have all the URLs consider / of `developers.domain.com` as root... (step 3 above)

But then I have the issue of testing and browsing on the dev server -- where the root path is '/developers' and not '/'.  On these pages , and only in dev, I'd need to rewrite the links base from "/" as "/developers/", which i could do in a tween...

and I just remembered typing this that there is a BASE html tag that lets me set a base URI... and I could probably just use that!
Reply all
Reply to author
Forward
0 new messages