skip to Main Content

I run some shopware 6.4.x shops.

However, these are running on an nginx server.

Since I would like to continue running nginx, I wanted to ask if there are already configuration templates for nginx.

I have tried to rewrite the .htaccess into a nginx config.

But I didn’t manage to translate this part correctly:

RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.)::2$
RewriteRule ^(.
) – [E=BASE:%1]

2

Answers


  1. Chosen as BEST ANSWER

    This is the nginx configuration I already have in use. However, this does not work with the new Shopware 6.5 installation using shopware-installer.phar.php.


  2. 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;
        }
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search