搭建lnmp环境-nginx关联php-fpm (第三步)
永久关闭防火墙
sudo systemctl stop firewalld
sudo systemctl disable firewall
有两个防火墙!如果上面那个关闭还不行,就继续关这个后重启。


需要关闭防火墙!才能访问,或者开放端口。
server {
listen 8080;
server_name 192.168.2.128;
root /usr/share/nginx/html/test1;
location / {
index index.php index.html index.htm;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
location ~ \.(php|phar)(/.*)?$ {
fastcgi_split_path_info ^(.+\.(?:php|phar))(/.*)$;
fastcgi_intercept_errors on;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass 127.0.0.1:9000;
}
}

systemctl restart nginx.service

setenforce 0


浙公网安备 33010602011771号