Welcome! Log In Create A New Profile

Advanced

Override /usr/local/html?

Posted by HippoMan 
Override /usr/local/html?
June 02, 2009 07:16PM
Hello.

I'm new to nginx, and so far, I'm quite impressed. Great work!

I have a question: is there a way to override the default location of [b]/usr/local/html[/b] for the installation of the sample startup site? I can't find any configure directives that control this. Also, it appears that [b]/usr/local/html[/b] is hard-coded into [b]objs/Makefile[/b], but perhaps that file gets auto-generated somehow ... ???

I'm willing to change [b]objs/Makefile[/b] by hand if necessary, but I'm hoping that there is a way to alter this pathname using the standard configuration system.

Thanks in advance for your help.
Re: Override /usr/local/html?
June 02, 2009 08:03PM
I believe the *default* location is /usr/local/nginx/html but if you use the option "--prefix=PATH" that will set it to whatever you like.

If you like the default layout and only want to change the location of the default server, do that in the root directive in nginx.conf:

[code]
server {
listen 80;
server_name myserver.com;


location / {
root /path/to/your/html;
index index.html index.htm;
}
}
[/code]

--
Jim Ohlstein
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 234
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