linux - CentOS 7 + Nginx + PHP + MySql + 項目例子,測試頁面能正確開啟,首頁面開啟一直顯示空白

來源:互聯網
上載者:User
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貼上來

  • 相關文章

    聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.