Skip to content

Instantly share code, notes, and snippets.

@sfelde
Created July 3, 2012 17:05
Show Gist options
  • Save sfelde/3041081 to your computer and use it in GitHub Desktop.
Save sfelde/3041081 to your computer and use it in GitHub Desktop.
oxid mit nginx
server {
# Hier die eigene VHost-Konfiguration einfügen
# listen, server_name, root, access_log, error_log, index
# OXID eShop Rewrite Regeln
set $script_name $fastcgi_script_name;
set $fcgi_php 127.0.0.1:9000;
# Im Admin und Setup wird kein Rewrite auf die oxseo.php benötigt.
location ~ ^/(setup|admin)/?$ {
set $script_name /$1/index.php;
include fastcgi_params.oxid;
}
# Zugriff auf die internen Dateien und Apache's ".ht" Dateien verweigern.
location ~ (/\.ht|EXCEPTION_LOG\.txt|\.log$|\.tpl$|pkg.rev) {
deny all;
}
# OXID 4.5.2+ spezifisch
location ~ /out/pictures/.*(\.jpg|\.gif|\.png)$ {
try_files $uri /core/utils/getimg.php;
}
# Für das "out" Verzeichnis sind keine Rewrite-Regeln anzuwenden.
location ~ /(core|export|modules|out|tmp|views)/ {
}
# OXID eShop Setup: Prüfung auf "mod_rewrite".
location = /oxseo.php {
if ($args ~ "mod_rewrite_module_is=off") {
rewrite /oxseo.php /oxseo.php?mod_rewrite_module_is=on? break;
}
set $script_name oxseo.php;
include fastcgi_params.oxid;
}
# PHP-Dateien über PHP-FastCGI ausführen.
location ~ \.php$ {
# Zero-day exploit defense.
# http://forum.nginx.org/read.php?2,88845,page=3
try_files $uri =404;
include fastcgi_params.oxid;
}
# SEO URLs auf die oxseo.php leiten.
location / {
if (!-e $request_filename) {
set $script_name /oxseo.php;
}
include fastcgi_params.oxid;
}
# Anfragen auf das Root Dokument auf die index.php leiten.
location = / {
fastcgi_index index.php;
set $script_name $fastcgi_script_name;
include fastcgi_params.oxid;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment