Welcome! Log In Create A New Profile

Advanced

Most secure multi-site Nginx setup

Posted by bobdorough 
Most secure multi-site Nginx setup
February 25, 2019 05:39AM
Hi all

I've some experience with NGINX but am really an IIS guy (sorry!) and am looking to make the jump on our servers from IIS to NGINX as I've been very impressed with its speed and flexibility. However, I have some (probably quite basic) questions regarding securing the setup:

1. IIS runs each site in its own pool which is great for isolation. If one bad PHP script ruins a site, it can't get access to any other sites on the server. I presume there's a similar way to set NGINX up but, from what I can currently see, all sites run under the NGINX user (www-data) and could, theoretically, traverse up beyond the site's root and access other sites to perform malicious actions? I'm sure I've got this wrong so perhaps someone can point me to a way to isolate each site in a way that's scalable?

2. Permissions – it seems NGINX requires fairly lax permissions to operate. The majority of the sites we host are WordPress and, even with the wp-content folder set to 775 and owned by the www-data group, sometimes WordPress still can't write its files and asks for FTP access. Obviously not going to set 777 so am having to use the FS_DIRECT method to ensure WordPress can write but this isn't ideal.

3. I'm using PHP FPM – is there anything in particular I should be doing to ensure a script running through FPM can't access system files / other websites? From what I've found, it looks as though the only way to achieve this is to set up individual users for each website (well over 100) which would require a significant amount more administration than IIS.

By the way, I'm aware all of this is due to my inexperience with NGINX and fully expect it is at least as capable as IIS so really grateful for pointers and assistance in filling in the gaps in my knowledge!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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