0

ルートフォルダーでxenforoフォーラムを使用します。Codeigniterフレームワークでフォルダー/somefolder/を追加します。nginxcoinfigを編集するにはどうすればよいですか?

server {
    listen       80;
    server_name  wwww.mysite.com mysite.com;
    access_log  /var/log/nginx/mysite_access.log;
error_log  /var/log/nginx/mysite_error.log;

location / {
        root   /usr/local/www/mysite;
        index  index.html index.htm index.php;
        try_files $uri $uri/ /index.php?$uri&$args;
        }    
    location /internal_data/ {
    internal;
    }
    location /library/ {
    internal;
    }           

    location ~ \.php$ {
    fastcgi_pass unix:/var/tmp/fpm/php-fpm.sock;
        fastcgi_index  index.php;
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_param  SCRIPT_FILENAME  /usr/local/www/mysite$fastcgi_script_name;
        include        fastcgi_params;
    }
4

1 に答える 1

0

次の設定を確認してください。/usr/local/www/mysite/ルート フォルダーと見なされます。

server {
    listen 80;
    server_name wwww.mysite.com mysite.com;
    access_log /var/log/nginx/mysite_access.log;
    error_log /var/log/nginx/mysite_error.log;

    location /internal_data/ {
        internal;
    }
    location /library/ {
        internal;
    }

    location /somefolder {
        root /usr/local/www/mysite/somefolder;
        if (!-e $request_filename) {
            rewrite ^/(.*)$ /somefolder/index.php?/$1 last;
            break;
        }
    }

    location / {
        fastcgi_pass unix:/var/tmp/fpm/php-fpm.sock;
        fastcgi_index index.php;
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_param SCRIPT_FILENAME  /usr/local/www/mysite$fastcgi_script_name;
        include fastcgi_params;
    }
}

お役に立てれば。

于 2013-03-07T20:41:40.147 に答える