Nginx reset failed
/usr/local/webserver/nginx/sbin/nginx -t
The following error
nginx: [alert] mmap(MAP_ANON|MAP_SHARED, 10737418240) failed (12: Cannot allocate memory)
nginx: configuration file /usr/local/webserver/nginx/conf/nginx.conf test failed
Nginx cache is implemented by MMAP, buffer size can not exceed the remaining sum of memory size and swapvalue.
Apache Rewrite rules:
RewriteRule ^/html/tagindex/([a-zA-Z]+)/.*$ /$1/ [R=301,L]
Nginx Rewrite rules:
rewrite ^/html/tagindex/([a-zA-Z]+)/.*$ http://$host/$1/ permanent;
Apache Rewrite rules:
RewriteRule ^/user/login/$ /user/login.php?login=1&forward=http://%{HTTP_HOST} [L]
Nginx Rewrite rules:
rewrite ^/user/login/$ /user/login.php?login=1&forward=http://$host last;
Some of the features of Apache and Nginx Rewrite rules of the same or similar like instruction, mark correspondence:
The RewriteCond instruction corresponds to the Nginx Apache if directive,
The RewriteRule instruction corresponds to the Nginx Apache rewrite directive,
Redirect [R] markers corresponding to Nginx Apache.,
Last [P] markers corresponding to Nginx Apache.,
Apache [R, redirect L] markers corresponding to Nginx,
Apache [P, last L] markers corresponding to Nginx,
Apache [PT, last L] markers corresponding to Nginx,
Nginx multiple rewrite instances
Nginx Rewrite rules:
if ($host ~* ^(.*?)\.domain\.com$)
{
set $var_wupin_city $1;
set $var_wupin '1';
}
if ($host ~* ^qita\.domain\.com$)
{
set $var_wupin '0';
}
if (!-f $document_root/market/$var_wupin_city/index.htm)
{
set $var_wupin '0';
}
if ($var_wupin ~ '1')
{
rewrite ^/wu/$ /market/$var_wupin_city/index.htm last;
}
Posted by Vic at February 15, 2014 - 7:09 AM