# Configure complex dynamic urls

**URL:** <https://www.ruby-forum.com/t/configure-complex-dynamic-urls/243997>\
**Category:** NGINX\
**Created:** [February 3, 2016, 8:23am UTC](https://www.ruby-forum.com/t/configure-complex-dynamic-urls/243997 "2016-02-03T08:23:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [February 3, 2016, 8:23am UTC](https://www.ruby-forum.com/t/configure-complex-dynamic-urls/243997/1 "2016-02-03T08:23:01Z")

</div>

Hi I’ve been trying to configure an nginx to accept a complex dynamic  
url,  
so far I got this. ([http://pastebin.com/aSmW5GPn](http://pastebin.com/aSmW5GPn)), this what I got so  
far.

Here is the deal, the url should be working like these:

[mydomain.com](http://mydomain.com) - will be the normal domain with information, user  
registration  
and user authentication. ([http://mydomain.com/signin](http://mydomain.com/signin),  
[http://mydomain.com/register](http://mydomain.com/register))

the user can create database from their account.  
[mydomain.com/database/create](http://mydomain.com/database/create), view the database information  
[mydomain.com/database/view](http://mydomain.com/database/view), and list all the database htey have created  
[http://mydomain.com/database/list](http://mydomain.com/database/list)

so far everything can be done and I can manage this.

The issue start here. to the user manage their database, create tables,  
etc,  
I want the url format to be: http://{user}.mydomain.com/{database}, this  
should proxy to a system/program that handles the database management  
(that  
should be hidden and only accessed by the url mention before).

If user go to http://{user}.mydomain.com/{database}/login, they are  
actually  
going to the another database manager, pre-filling the username and  
database  
to be used.

Thanks for you help in advance

PS. [mydomain.com](http://mydomain.com) is using nginx+php and the database management software  
is  
using htaccess+php+nginx

Posted at Nginx Forum:

> **[Configure complex dynamic urls](https://forum.nginx.org/read.php?2,264302,264302#msg-264302)**
>
> Hi I've been trying to configure an nginx to accept a complex dynamic url, so far I got this. (http://pastebin.com/aSmW5GPn), this what I got so far. Here is the deal, the url should be working like these: mydomain.com - will be the normal domain...
