只运行过这些代码 yum install -y vim wget zip unzip git httpd php php-mysql php-odbc php-ldap php-gd php-mbstring php-xml php-xml-rpc php-bcmath libjpeg* mariadb ; rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm; yum install -y nginx; service nginx start systemctl enable nginx.service firewall-cmd --zone=public --add-port=80/tcp --permanent firewall-cmd --reload 我是centos7 这个是nginx的配置 server { listen 80; root /usr/share/nginx/html/mysite; index index.html index.htm index.php; server_name localhost; location / { # URL重写支持 try_files $uri $uri/ /index.php?s=$uri&$args; } # 开启PHP支持 location ~ \.php { fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param PATH_INFO $fastcgi_path_info; # 环境变量 fastcgi_param CT_DEV_MODE 'true'; # 加载Nginx默认"服务器环境变量"配置 include fastcgi_params; } }
页面提示403 Forbidden还有nginx的版本号
筑梦之路