0

如果 shopware 在根目录中,我有以下 nginx 配置可以正常工作。但我想将所有文件都放在 /shop 目录中。我将位置 / 更改为 /shop/ 但这不起作用。

有人知道我如何告诉 nginx shopware 在子目录 /shop 中吗?

location ~ /(engine|images/[a-z]+|files|templates)/ {
}

location / {
         index index.html index.php shopware.php;
         rewrite shopware.dll /shopware.php;
         rewrite files/documents/.* /engine last;
         rewrite images/ayww/(.*) /images/banner/$1 last;
         rewrite backend/media/(.*) /media/$1 last;
         if (!-e $request_filename){
            rewrite . /shopware.php last;
         }
}

location ~ \.(tpl|yml|ini)$ {
         deny all;
}

location /install/ {
         location /install/assets {
         }
         if (!-e $request_filename){
            rewrite . /install/index.php last;
         }
}

location /update/ {
         location /update/assets {
         }
         location /update/templates {
         }
         if (!-e $request_filename){
             rewrite . /update/index.php last;
         }
}

location /recovery/install/ {
         location /recovery/install/assets {
         }
         if (!-e $request_filename){
            rewrite . /recovery/install/index.php last;
         }
}

location /recovery/update/ {
         location /recovery/update/assets {
         }
         if (!-e $request_filename){
            rewrite . /recovery/update/index.php last;
         }
}

location @php { ##merge##
            #fastcgi_buffer_size 128k;
            #fastcgi_buffers 256 16k;
            #fastcgi_busy_buffers_size 256k;
            #fastcgi_temp_file_write_size 256k;
            fastcgi_temp_file_write_size 10m;
            fastcgi_busy_buffers_size    512k;
            fastcgi_buffer_size          512k;
            fastcgi_buffers           16 512k;
            fastcgi_read_timeout 1200;
}
4

2 回答 2

0

根?

root /var/www/domain.com/shop;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
于 2015-03-18T00:25:34.070 回答
0

将此添加到 nginx 配置中:

# before block location /
location /shop {
    index shopware.php index.php;
    try_files $uri $uri/ /shop/shopware.php$is_args$args; 
}
于 2019-06-28T08:37:45.407 回答