I have a web site developed in modx revolution with latest version. It has Babel extra for multilanguage (two languages kz and ru). Friednly Aliases turned ON.
It worked fine with Apache+PHP5+MYSQL configuration in Centos6.
Nearly I've changed my VPS to Debian Weezy 7, and installed nginx+php5-fpm+mysql.
Here's list of
not working URL's that by browser
keep trying to download them as HTML files or unknown file.
Here's list of
working URL's
Here's list of URL's with
503 error response
I've looked up on offical sites and forums about this issue, but it seems to be not working how I expected (half working). What have I missed?
----------
/etc/nginx/nginx.conf
user www-data;
worker_processes 2;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log warn;
##
# Gzip Settings
##
gzip on;
gzip_disable "MSIE [1-6].(?!.*SV1)";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 1;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
----------
/etc/nginx/sites-available/site.kz
server {
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80 default_server ipv6only=on; ## listen for ipv6
server_name site.kz www.site.kz;
root /usr/share/nginx/www/site.kz;
index index.php index.html index.htm;
client_max_body_size 30M;
error_log /var/log/nginx/site.kz.error_log notice;
rewrite_log on;
location @modx-rewrite {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
set $lang kz;
# choose the language that appears first in the accept_language header
if ($http_accept_language ~* "(kz|ru)") {
set $lang $1;
}
location ~ ^/$ {
rewrite ^ $lang/ redirect;
}
location ~ ^/(kz|ru) {
# redirect favicon.ico and assets/* and core/* requests to site root
rewrite ^/(kz|ru)/(favicon.ico|assets.*|core.*)$ /$2 redirect;
# main Babel rewrite
rewrite ^/(kz|ru)/(.*)$ /?cultureKey=$1&q=$2 break;
# MODX rewrite
try_files $uri $uri/ @modx-rewrite;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_ignore_client_abort on;
fastcgi_param SERVER_NAME $http_host;
}
location / {
try_files $uri $uri/ @modx-rewrite;
}
location ~ /\.ht {
deny all;
}
}
----------
Previous working Apache .htaccess configuration
# The Friendly URLs part
# detect language when requesting the root (/)
RewriteCond %{HTTP:Accept-Language} !^kz [NC]
RewriteRule ^$ kz/ [R=301,L]
RewriteRule ^$ ru/ [R=301,L]
# redirect all requests to /kz/favicon.ico and /ru/favicon.ico
# to /favicon.ico
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(kz|ru)/favicon.ico$ favicon.ico [L,QSA]
# redirect all requests to /kz/assets* and /ru/assets* to /assets*
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(kz|ru)/assets(.*)$ assets$2 [L,QSA]
# redirect all requests to /kz/core* and /ru/core* to /core*
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteRule ^(kz|ru)/core(.*)$ core$2 [L,QSA]
# redirect all other requests to /kz/* and /ru/*
# to index.php and set the cultureKey parameter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(kz|ru)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]