Nginx TYPO3 Direktiven

bernie

Member
Hi, eine TYPO3 Website funktioniert mit untenstehenden Direktiven bestens ohne www. Mit www spuckt der Server einen 500er Error aus. Das Fehlerprotokoll bleibt aber leer? Kann mir jemand auf die Sprünge helfen? DNS Einträge www besteht. Server name im vhost File ist korrekt mit und ohne www.

Code:
location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ {
expires max;
log_not_found off;
}
location ~* \.(cur|ico|gif|png|jpe?g|css|js|swf|woff)((\?\d\d\d\d\d\d\d\d\d\d)|(\?s=\d\d\d\d\d\d\d\d\d\d))$ {
expires max;
log_not_found off;
}
location ~* \.(cur|ico|gif|png|jpe?g|css|js|swf|woff)(\?v\d\d?\.\d\d?\.\d\d?)$ {
expires max;
log_not_found off;
}
location ~* ^(/typo3/sysext|/typo3conf/ext).*\.(cur|ico|gif|png|jpe?g|css|js|swf|woff) {
expires max;
log_not_found off;
}
location = /clear.gif {
empty_gif;
expires max;
}
location ^~ /typo3/gfx {
expires max;
}
location ^~ /typo3temp/compressor {
expires max;
}
location ~* \.(sql|htaccess|htpasswd|tpl|html5|xhtml) {
deny all;
}

location / {
if ($query_string ~ ".+") {
return 405;
}
# pass requests from logged-in users to PHP
if ($http_cookie = 'nc_staticfilecache|be_typo_user' ) {
return 405;
} # pass POST requests to PHP
if ($request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
if ($http_pragma = 'no-cache') {
return 405;
}
if ($http_cache_control = 'no-cache') {
return 405;
}
error_page 405 = @nocache;

# serve requested content from the cache if available, otherwise pass the request to PHP
try_files /typo3temp/tx_ncstaticfilecache/$host${request_uri}index.html @nocache;
}

location @nocache {
try_files $uri $uri/ /index.php?$args;
}

location ^~ /typo3temp/tx_ncstaticfilecache {
expires 43200;
charset utf-8;
}
 

Till

Administrator
Schau mal ob die www subdomain wirklich auf die selbe IP verweist und stell sicher dass auto-subdomain der website auf www steht in ISPConfig.
 

bernie

Member
Das Letsencrypt Zertifikat wurde auch korrekt ausgestellt, und wird bei ohne und bei mit www angezeigt. Mit www einfach mit einem 500er Fehler.
 

Till

Administrator
Bist Du sicher dass Du ins richtige error.log geschaut hast, wennd ann steht der fehler im error.log der website, also nicht im globalen error.log. Ein 500er fehler muss im log stehen, tut er das nicht legt das den Schluss nahe dass Du auf eine andere website bzw. einen anderen vhost oder server zugreifst.
 

bernie

Member
Es steht weder im globalen noch im individuellen Log was drin. Das ist, was ich auch nicht verstehe.
 

bernie

Member
Ich seh den Zugriff auf dem access.log lustigerweise:
169.1.22.XXX - - [06/Dec/2019:16:23:36 +0100] "GET /index.php HTTP/1.1" 500 1851 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"
 

bernie

Member
mit www:
169.1.22.xxx - - [06/Dec/2019:16:28:01 +0100] "GET /home/ HTTP/1.1" 500 1851 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"
ohne www:
169.1.22.xxx - - [06/Dec/2019:16:27:10 +0100] "GET /home/ HTTP/1.1" 200 6711 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"
 

Till

Administrator
Ok, dann kommt es zumindest in der richtigen website an. Error codes können ja nicht nur vom server gesendet werden sondern auch von der installierten Applikation, also in dem Fall dem CMS. Kann es sein dass der 500er code von Typo3 kommt? Hat typo3 vielleicht ein eigenes log wo etwas dazu drin steht?
 

bernie

Member
ja, da gibts ein log, aber da steht nichts aussagekräftiges drin. gibt es eine verkürzte typo3 nginx direktive, die man austesten könnte?
 

bernie

Member
Ok, vielen Dank allen. Problem gelöst. Sobald ich die 'eigenen Fehlerseiten' deaktiviert hatte, wurden die TYPO3 Fehlermeldung ersichtlich. Das Ganze ist ein TYPO3 Bug (https://forge.typo3.org/issues/85062), die Lösung war das Hinzufügen von $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] = '.*'; zur AdditionalConfiguration.php.
 

Werbung

Top