Welcome Guest. Please Login or Register  


You are here: Index > Webuzo > General Support > Topic : Extend an nginx server block



Threaded Mode | Print  

 Extend an nginx server block, How add Nginx's location block for specific server block (6 Replies, Read 23340 times)
erile
Group: Member
Post Group: Working Newbie
Posts: 64
Status:
Hello,

New in Webuzo, I have to add a location block about a server block pointing a subdomain.

I well saw that the server block is declared in /usr/local/apps/nginx/etc/conf.d/webuzoVH.conf but, unless mistake, this file is subject to be overwritten by Webuzo...

So, where can I add my location block belonging to this specific server block?

TIA

Context: VPS with CentOS 7 and Webuzo; and Nginx of course.

-----------------------
OpenVZ VPS, CentOS 7, Webuzo Premium / Desktop and full-stack dev w/ C, C++, Python, Perl, javascript...
IP: --   

Extend an nginx server block
erile
Group: Member
Post Group: Working Newbie
Posts: 64
Status:
OK, found the way to add extra config to a specific server block going through Webuzo's Extra Configuration. Solved :)

-----------------------
OpenVZ VPS, CentOS 7, Webuzo Premium / Desktop and full-stack dev w/ C, C++, Python, Perl, javascript...
IP: --   

Extend an nginx server block
Dhanya
Group: Member
Post Group: Working Member
Posts: 200
Status:
Hi,

Yes. You can add the extra code block for your primary domain/subdomains from Extra Configuration page. But can you tell us what issue where you facing with subdomain? If you had set wrong directory path for your subdomain at the time of its creation then you can simply edit the subdomain and change the directory path as per your requirement.

Also note that any changes to webuzoVH.conf of your web server will be reverted to default automatically when you add a  domain or change your web server or PHP version from default apps page. Hence its always good to add extra code block for your domains from Extra Configuration page.

Let us know.

Edited by Dhanya : July 25, 2019, 4:46 am
IP: --   

Extend an nginx server block
erile
Group: Member
Post Group: Working Newbie
Posts: 64
Status:
Hi Dhanya, Thanks for the clarification...

I had no issue with my subdomain, I just wanted to add a location block inside the server block about this subdomain. The subdomain is something like webmail.mydomain.com and the location block I added is to deny access to data directory of a Rainloop installation on this subdomain. So, now, it works like a charm.

-----------------------
OpenVZ VPS, CentOS 7, Webuzo Premium / Desktop and full-stack dev w/ C, C++, Python, Perl, javascript...
IP: --   

Extend an nginx server block
Dhanya
Group: Member
Post Group: Working Member
Posts: 200
Status:
Hi,

Glad to know that the code block you have added is working.

When adding code block you need to add code block to be added inside server{...} excluding server{} because in nginx.conf file we include the extra configuration file inside the server block.

Let us know if you have any further queries.
IP: --   

Extend an nginx server block
erile
Group: Member
Post Group: Working Newbie
Posts: 64
Status:
Yep! well understood now :) Thanks again.

Here is the content of the extra conf file I added:
# Rainloop data directory protection
location /data {
  deny all;
}


-----------------------
OpenVZ VPS, CentOS 7, Webuzo Premium / Desktop and full-stack dev w/ C, C++, Python, Perl, javascript...
IP: --   

Extend an nginx server block
Dhanya
Group: Member
Post Group: Working Member
Posts: 200
Status:
Hi,

Glad to help you.

Let us know if you face any issues further.
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is March 19, 2024, 4:50 am.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:0.021