NGINX - 子目录中的Shopware

时间:2015-03-17 18:37:04

标签: nginx shopware

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

有人知道我怎么能告诉nginx商品是在子目录/商店吗?

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;
}

2 个答案:

答案 0 :(得分:0)

根?

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

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

答案 1 :(得分:0)

将此添加到nginx配置:

decorationThickness