This article is a mirror article of machine translation, please click here to jump to the original article.

View: 13500|Reply: 0

[Other] nginx+php security hardening configuration

[Copy link]
Posted on 8/22/2017 12:12:59 PM | | |
php can access files across directories by default, we need to give him a limit, a separate limit for each virtual host,
That's right, it's open_basedir. Here we need special tricks, limit each virtual machine

This will allow the web host to run only in the website directory and the tmp directory, and not to traverse to other directories

The nginx separate website configuration file is as follows:
(If a site needs to set up additional directories separately, write the above code in include fastcgi.conf; This line is OK, and the settings in fastcgi.conf will be overridden. )



If you set it globally, you don't need to set up each site individually, the configuration is as follows:

Join in the Nginx configuration file


Usually include fastcgi.conf is used in the nginx site configuration file; In this way, just add this line to fastcgi.conf.


After the above methods are completed, you need to restart the nginx service.


The recommended prohibited functions are as follows:
disable_functions = pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_ setpriority, eval, popen, passthru, exec, system, shell_exec, proc_open, proc_get_status, chroot, chgrp, chown, ini_alter, ini_restore, dl, pfsockopen, openlog, syslog, readlink, symlink, popepassthru, stream_socket_server, fsocket, chdir









Previous:.net/c# Wanke Cloud Grab Activation Code Tool [Source Code]
Next:The newcomer reported, please take care of the gods
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com