跳转到主要内容
东方龙马 提交于 29 October 2014

Nginx下Drupal站点的配置参考

文件路径:/opt/nginx-1.4.2/conf/sites/drupalchina.cn.conf,以下是代码部分,仅供参考:

server {
        listen 80;
        server_name  www.drupalchina.cn;
        rewrite ^(.*)$ $scheme://drupalchina.cn$1;
}
server {
        listen       80;
        server_name  drupalchina.cn;
        client_max_body_size 8M;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

	root /var/www/drupalchina.cn;
        location / {
            index  index.php index.html index.htm;
        if (!-e $request_filename) {
            rewrite ^/(.*)$ /index.php?q=$1 last;
        }
        }

send_timeout 60;
        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
        #    root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root/$fastcgi_script_name;
            include        fastcgi_params;
        }
    }
标签
Drupal 版本