CentOS 7 + Nginx + PHP + MySql + 項目例子,環境搭建及nginx.conf更新後,測試頁面http://wkb.kquanr.com/test.php能正確開啟,但http://wkb.kquanr.com首頁面開啟一直顯示空白
在nginx.conf裡面已經配置好伺服器,已經添加fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
資料庫連接正確,且正確匯入相關資料庫sql檔案,項目重新導向頁面還是打不開,一直顯示空白,希望懂這塊的朋友可以幫忙指點一下,謝謝啦
以下是nginx.conf設定檔
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"';client_max_body_size 1024M;access_log /var/log/nginx/access.log main;sendfile on;tcp_nopush on;tcp_nodelay on;keepalive_timeout 65;types_hash_max_size 2048;include /etc/nginx/mime.types;default_type application/octet-stream;# Load modular configuration files from the /etc/nginx/conf.d directory.# See http://nginx.org/en/docs/ngx_core_module.html#include# for more information.include /etc/nginx/conf.d/*.conf;server { listen 80; server_name wkb.kquanr.com www.wkb.kquanr.com; root /var/www/weikeba/web; access_log /var/log/nginx/weikeba.access.log; error_log /var/log/nginx/weikeba.error.log; location / { index app.php; try_files $uri @rewriteapp; } location @rewriteapp { rewrite ^(.*)$ /app.php/$1 last; } location ~ ^/udisk { internal; root /var/www/weikeba/app/data/; } location ~ ^/(app|app_dev)\.php(/|$) { fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS off; fastcgi_param HTTP_X-Sendfile-Type X-Accel-Redirect; fastcgi_param HTTP_X-Accel-Mapping /udisk=/var/www/weikeba/app/data/udisk; fastcgi_buffer_size 128k; fastcgi_buffers 8 128k; } location ~* \.(jpg|jpeg|gif|png|ico|swf)$ { expires 3y; access_log off; gzip off; } location ~* \.(css|js)$ { access_log off; expires 3y; } location ~ ^/files/.*\.(php|php5)$ { deny all; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS off; }}
}
回複內容:
CentOS 7 + Nginx + PHP + MySql + 項目例子,環境搭建及nginx.conf更新後,測試頁面http://wkb.kquanr.com/test.php能正確開啟,但http://wkb.kquanr.com首頁面開啟一直顯示空白
在nginx.conf裡面已經配置好伺服器,已經添加fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
資料庫連接正確,且正確匯入相關資料庫sql檔案,項目重新導向頁面還是打不開,一直顯示空白,希望懂這塊的朋友可以幫忙指點一下,謝謝啦
以下是nginx.conf設定檔
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"';client_max_body_size 1024M;access_log /var/log/nginx/access.log main;sendfile on;tcp_nopush on;tcp_nodelay on;keepalive_timeout 65;types_hash_max_size 2048;include /etc/nginx/mime.types;default_type application/octet-stream;# Load modular configuration files from the /etc/nginx/conf.d directory.# See http://nginx.org/en/docs/ngx_core_module.html#include# for more information.include /etc/nginx/conf.d/*.conf;server { listen 80; server_name wkb.kquanr.com www.wkb.kquanr.com; root /var/www/weikeba/web; access_log /var/log/nginx/weikeba.access.log; error_log /var/log/nginx/weikeba.error.log; location / { index app.php; try_files $uri @rewriteapp; } location @rewriteapp { rewrite ^(.*)$ /app.php/$1 last; } location ~ ^/udisk { internal; root /var/www/weikeba/app/data/; } location ~ ^/(app|app_dev)\.php(/|$) { fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS off; fastcgi_param HTTP_X-Sendfile-Type X-Accel-Redirect; fastcgi_param HTTP_X-Accel-Mapping /udisk=/var/www/weikeba/app/data/udisk; fastcgi_buffer_size 128k; fastcgi_buffers 8 128k; } location ~* \.(jpg|jpeg|gif|png|ico|swf)$ { expires 3y; access_log off; gzip off; } location ~* \.(css|js)$ { access_log off; expires 3y; } location ~ ^/files/.*\.(php|php5)$ { deny all; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS off; }}
}
nginx.conf貼上來