Shopware 6.5 nginx配置[已关闭]

mwyxok5s  于 2023-05-16  发布在  Nginx
关注(0)|答案(1)|浏览(140)

**已关闭。**此问题正在寻求书籍、工具、软件库等的建议。它不符合Stack Overflow guidelines。目前不接受答复。

我们不允许问题寻求书籍,工具,软件库等的建议。您可以编辑问题,以便可以用事实和引用来回答。
2天前关闭。
Improve this question
我经营一些商店6.4.x商店。
但是,这些都运行在nginx服务器上。
由于我想继续运行nginx,我想问是否已经有nginx的配置模板。
我尝试将.htaccess重写为nginx配置。
但我没能正确翻译这部分:
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.)::\2$ RewriteRule ^(.)- [E=BASE:%1]

7uhlpewt

7uhlpewt1#

server {
    listen 80;

    index index.php index.html;
    server_name localhost;

    client_max_body_size 128M;

    root /var/www/html/public;

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }
    
    location = /sw-domain-hash.html {
        try_files $uri /index.php$is_args$args;
    }

    location ~* ^.+\.(?:css|cur|js|jpe?g|gif|ico|png|svg|webp|html)$ {
        expires max;
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";

        access_log off;
        log_not_found off;

        tcp_nodelay off;
        ## Set the OS file cache.
        open_file_cache max=3000 inactive=120s;
        open_file_cache_valid 45s;
        open_file_cache_min_uses 2;
        open_file_cache_errors off;
    }
    
    # Shopware install / update
    # new for Shopware 6.5
    location /shopware-installer.phar.php {
        try_files $uri /shopware-installer.phar.php$is_args$args;
    }

    location /recovery/install {
        index index.php;
        try_files $uri /recovery/install/index.php$is_args$args;
    }

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

    location / {
        try_files $uri /index.php$is_args$args;
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi.conf;
        fastcgi_param HTTP_PROXY "";
        fastcgi_param HTTPS $fcgi_https;
        fastcgi_buffers 8 16k;
        fastcgi_buffer_size 32k;
        fastcgi_read_timeout 300s;
        client_body_buffer_size 128k;
        fastcgi_pass 127.0.0.1:9000;
        http2_push_preload on;
    }
}

相关问题