# Shopware 4.3 unter Plesk 12 mit NGINX - Erfahrungen?!

**URL:** https://forum.shopware.com/t/shopware-4-3-unter-plesk-12-mit-nginx-erfahrungen/21926
**Category:** Shopware 3.5
**Tags:** general
**Created:** [17. August 2014 um 14:59 UTC](https://forum.shopware.com/t/shopware-4-3-unter-plesk-12-mit-nginx-erfahrungen/21926 "2014-08-17T14:59:46Z")
**Posts on this page:** 1
**Showing post:** 35

<div class="post-metadata">

### Author: ![dogado\_shops](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@dogado\_shops](https://forum.shopware.com/u/dogado_shops)
#### Post date: [23. Dezember 2015 um 08:42 UTC](https://forum.shopware.com/t/shopware-4-3-unter-plesk-12-mit-nginx-erfahrungen/21926/35 "2015-12-23T08:42:05Z")

</div>

Hm - melde Dich mal in unserem Demo Shop an unter [https://shopware5.aixpro.de](https://shopware5.aixpro.de) (Benutzer: admin, Kennwort: aixpro2015) - dieser läuft mit folgenden zusätzlichen nginx Anweisungen als auch PHP7 auf Basis von Plesk 12.5: ------------------------------------------------------------ if ($scheme !~\* ^https ){ rewrite ^ https://$server\_name$request\_uri? permanent; } location = / { index index.html index.php shopware.php; rewrite shopware.dll /shopware.php; rewrite files/documents/.\* /engine last; rewrite backend/media/(.\*) /media/$1 last; if (!-e $request\_filename){ rewrite . /shopware.php last; } } # Shopware \>= 4.3 install / update location /recovery/install { index index.php; try\_files $uri /recovery/install/index.php?$args; } location /recovery/update { index index.php; try\_files $uri /recovery/update/index.php?args; } location = /favicon.ico { log\_not\_found off; access\_log off; } location = /templates/\_default/backend/\_resources/resources/css/icon-set.css { gzip off; } ## Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS\_Store (Mac). location ~ /\. { deny all; access\_log off; log\_not\_found off; } ## Deny all attems to access possible configuration files location ~ \.(tpl|yml|ini|log) { deny all; } ## Deny access to media upload folder location ^~ /media/temp/ { deny all; } # Shopware \< 5.1 caches location ^~ /cache/ { deny all; } # Shopware \>= 5.1 caches and logs location ^~ /var/ { deny all; } location ^~ /files/documents/ { deny all; } ## Fallback for old media paths location ^~ /media/ { try\_files uri /shopware.php?controller=Media&action=fallback; } # Block direct access to ESDs, but allow the follwing download options: # \* 'PHP' (slow) # \* 'X-Accel' (optimized) # Also see [url=http://wiki.shopware.com/ESD\_detail\_1116.html#Ab\_Shopware\_4.2.2]http://wiki.shopware.com/ESD\_detail\_111 ... ware\_4.2.2[/url] location ^~ /files/552211cce724117c3178e3d22bec532ec/ { internal; } # Breaks backend/media/ rewrite # #location ~ /(engine|files|templates|media)/ { # location ~ \.php { # return 403; # } #} location ~\* “^/themes/Frontend/Responsive/frontend/\_public/vendors/fonts/open-sans-fontface/(?:.+).(?:ttf|eot|svg|woff)" { expires max; add\_header Cache-Control "public"; access\_log off; log\_not\_found off; } location ~\* "^/themes/Frontend/Responsive/frontend/\_public/src/fonts/(?:.+)\.(?:ttf|eot|svg|woff)” { expires max; add\_header Cache-Control “public”; access\_log off; log\_not\_found off; } location ~\* “^/web/cache/(?:[0-9]{10})\_(?:.+).(?:js|css)$” { expires max; add\_header Cache-Control “public”; access\_log off; log\_not\_found off; } ## Defining rewrite rules rewrite files/documents/.\* /engine last; rewrite backend/media/(.\*) /media/$1 last; access\_log off; # The directive enables or disables messages in error\_log about files not found on disk. 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; ## Fallback to shopware ## comment in if needed #try\_files $uri @shopware; ## XML Sitemap support. location = /sitemap.xml { log\_not\_found off; access\_log off; try\_files uri @shopware; } ## robots.txt support. location = /robots.txt { log\_not\_found off; access\_log off; } location ~ \.php { try\_files $uri $uri/ =404; } location ~ /(engine|images/[a-z]+|files|templates)/ { rewrite files/documents/.\* /engine last; } if (!-e request\_filename){ rewrite ^(.\*) /shopware.php break; } ------------------------------------------------------------ Anzumerken ist noch, dass wir aktuell “Statische Dateien direkt durch nginx bedienen” aktiviert haben zur Steuerung der Expires Header. In Plesk 12.5 gibt es einen Bug im Default Domain-Template, welches Angaben zu Expires in Deinen individuellen nginx-Direktiven überschreibt. Bis ein Patch zur Verfügung steht, verwenden wir hierfür ein modifiziertes Custom-Template - diese kannst Du unter /usr/local/psa/admin/conf/templates anlegen. VG

---

_[View the full topic](https://forum.shopware.com/t/shopware-4-3-unter-plesk-12-mit-nginx-erfahrungen/21926)._
