Konflik-Rewrite-Rules /nginx
July 08, 2014 04:41AM
Hallo Zusammen,

nachdem ich erfolgreich ISPConfig auf einen dedizierten Debian-Root-Server installiert habe, stehe ich vor folgendem Problem:

Auf einer bereits angelegten SSL-Domain, sollen 3 unterschiedliche Scripte installiert werden:

1. Ein Community-Script im Verzeichnis MeineDomain/community/
2. Ein JobPortal-CMS im Verzeichnis MeineDomain/cms/
3. Mehrere Wordpress-Installationen im Verzeichnis MeineDomain/wordpress/

Seitens des Community-Scriptes, liegen mir folgende nginx-Direktiven vor:

Code:
server {
listen 80;
server_name www.example.com example.com;
root /var/www/example.com;

if ($http_host != "www.example.com") {
rewrite ^ http://www.example.com$request_uri permanent;
}

index index.php index.html;

location = /favicon.ico {
log_not_found off;
access_log off;
}

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

location / {
try_files $uri $uri/ /index.php?do=$uri&$args;
}

location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ {
expires max;
log_not_found off;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}
Für WORDPRESS nutze ich die optimalen Einstellungen von Falko Timme:

Code:
location / {
try_files $uri $uri/ /index.php?$args;
}
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ {
expires max;
log_not_found off;
}
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
Für das Job-Script erhielt ich folgende .htaccess-Einstellungen:

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /cms/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /cms/index.php [L]
</IfModule>


Der htaccess-Konverter spuckte hierfür kein zufriedenstellende Lösung heraus und ich bin mir ziemlich sicher, dass man die Direktiven noch vereinfachen und optimieren kann. Kann mir dabei jemand helfen?

Lieben Gruß im Voraus
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 252
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready