[Lösung] Contao Themeplus + nginx + proxy = assets funktionieren nicht.
Hallo zusammen,
ich bin mit meiner Entwicklungsumgebung auf den nginx umgezogen. Dort hatte ich das Problem,
dass die proxy.php nicht funktioniert und damit alle CSS + JS Dateien nicht verfügbar sind.
Lösung:
Im Contao Wiki steht dazu nur " Unter nginx funktioniert der Proxy nicht richtig." und das eine Weiterleitung notwendig ist.
Da ich bei Google noch nichts dazu gefunden habe, möchte ich hier meine Konfiguration teilen:
PHP-Code:
server {
listen 80;
server_name contao.test;
set $webroot '/Users/username/workspace/contao';
set $errlog "{$webroot}/logs/nginx.log";
set $acclog "{$webroot}/logs/access.log";
root $webroot;
error_log $errlog;
access_log $acclog;
location ~ /(.*\.php)(/.*)$ {
set $script_filename $document_root$1;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
fastcgi_param PATH_INFO $2;
}
location / {
try_files $uri $uri/ /index.php?$args;
rewrite "^/[a-z]{2}/$" /index.php break;
rewrite "^/([a-z]{2})$" /$1/ redirect;
}
}
Meine fastcgi_params enthält zusätzlich zum noch
PHP-Code:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
Ich hoffe es hilft dem ein oder anderen weiter :).
Grüße
Simon