# Setting document root with module

**URL:** <https://www.ruby-forum.com/t/setting-document-root-with-module/214484>\
**Category:** NGINX\
**Created:** [December 2, 2011, 11:06pm UTC](https://www.ruby-forum.com/t/setting-document-root-with-module/214484 "2011-12-02T23:06:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [December 2, 2011, 11:06pm UTC](https://www.ruby-forum.com/t/setting-document-root-with-module/214484/1 "2011-12-02T23:06:01Z")

</div>

Hi,

I’m investigating the prospects of setting $document\_root based of a  
value sitting in a text file. Not believing that I could just have the  
configuration file read from a .txt, my initial thought was to create a  
module, calling the directive in nginx.conf and passing the path to the  
txt file there, and using the module to set $document\_root according to  
the contents of the text file. Unsure how to accomplish this at the  
moment. Anyone have any advice/solutions for this problem?

Thanks!  
Jason

Posted at Nginx Forum:

> **[Setting document root with module](https://forum.nginx.org/read.php?2,219511,219511#msg-219511)**
>
> Hi, I'm investigating the prospects of setting $document\_root based of a value sitting in a text file. Not believing that I could just have the configuration file read from a .txt, my initial thought was to create a module, calling the directive in...
