Squid has a mechanism by which incoming URL's can be passed to an
external program to be rewritten and the reverse proxy subsequently
calls out to the rewritten URL
http://wiki.squid-cache.org/SquidFaq/SquidRedirectors
Is there a way to emulate this from within nginx
Thanks, Yusuf
i installed Wordpress today on nginx and everything seems ok except one
"small" issue, i don't know how to convert the rewrite rules.
So if anybody has any experience or knows how to do it i'd be gratefull
cause they have only Apache examples :(
RewriteEngine On
RewriteBase /
# Rewrite www.domain.com to domain.com
RewriteCond %{HTTP_HOST} ^www\.(.*)
RewriteRule ^(.*) http://%1/$1 [R,L]
#uploaded files
RewriteRule ^(.*)?/?files/(.*) wp-content/blogs.php?file=$2 [L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
Thank you.
I built a test nginx server on debian linux within a virtual machine on my laptop and it was quite fast. Based on the results of that simple test I built a stand alone server on an HP Proliant DL360. Everything from a software standpoint should be the same, but the performance on the real hardware is TERRIBLE. A simple index page on the server hardware takes almost a minute to load, while the same loaded from the laptop takes less than a second.
Does anyone have any ideas how a dual-Xeon server is slower than a VM on my laptop with 128mb?
Casey
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.18.3/694 - Release Date: 2/20/2007 1:44 PM
Is there a way to use 2 if statements together either nested or in one line
in the nginx config? Here is what I want to do
For a given location /things I want to check if a query parameter has a
certain value, and I also want to check the referer and if both match then
do a redirect
I tried doing this and a few other things but couldn't figure out how to
chain multiple if statements together.
location = /things {
if ($http_referer ~* ".*bob.com.*" && $args ~* "12345") {
rewrite ^/things$ /thing.disabled break;
}
So if someone coming from bob.com requests things?thing_id=12345 I want to
send them to a disabled page. I tried checking for the query parameters in
the location definition block but it didn't have the parameters.
I'm using runit to supervise nginx, and to get it to work properly, I
had to set
daemon = off;
In the nginx.conf. The documentation says that this shouldn't be used
in production. I was wondering why this was and if it is safe to keep
running like this.
Cheers,
Chris
Changes with nginx 0.5.14 23 Feb 2007
*) Bugfix: nginx ignored superfluous closing "}" in the end of
configuration file.
--
Igor Sysoev
http://sysoev.ru/en/
Dear all,
Is there an equivalence of mod_evasive (for Lighttpd) that I can use?
I run Nginx for Rails app, using Nginx to serve static content and
Mongrel to serve Rails content. It works very well. But I get the
occasional DOS that I could divert with mod_evasive. I would like the
same for Nginx.
Thank you,
Shark
I'm wondering how to make certain files with no file extensions execute as PHP
files.
In Apache, this is what I use:
<Location /search>
ForceType application/x-httpd-php
</Location>
In Lighttpd, this is what I use:
fastcgi.map-extensions = ( "/search" => ".php" )
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/tmp/php-fastcgi.socket",
...
I'm trying not to use rewrites because URLs like http://host/search/a&b becomes
http://host/search.php?a&b with:
location ~ ^/search {
root /root/path;
rewrite ^/search?(.*)$ /search.php?$1 break;
}
Using
location /search/ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /root/path/search.php;
include fastcgi_params;
}
drops the input parameter. I'm thinking I need to alter
fastcgi_param QUERY_STRING $query_string;
?
Hi,
I'd like to rotate my nginx logs using cronolog and wanted to know if anyone
else knows how to do it. In the nginx config, I'm trying to pipe the
results to cronolog but not having any success. Is there a way to do this
in nginx? Here is what I tried:
access_log "| /usr/local/sbin/cronolog /web/logs/%Y/%m/%d/access.log";
Thanks,
Andy