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.
Hi there,
We have developers working with various versions of web servers and
programming languages, for different clients and environments.
I'm trying to do this:
server {
listen 80;
server_name apache1 *.apache1.*.mydomain.com;
location / {
proxy_pass http://127.0.0.1:4000;
}
}
server {
listen 80;
server_name apache2 *.apache2.*.mydomain.com;
location / {
proxy_pass http://127.0.0.1:5000;
}
}
server {
listen 80;
server_name litespeed *.litespeed.*.mydomain.com;
location / {
proxy_pass http://127.0.0.1:6000;
}
}
server {
listen 80;
server_name php5 *.php5.*.mydomain.com;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
[...]
}
}
With this configuration, the host dev1.mydomain.com could serve:
http://site1.apache1.dev1.mydomain.com/ --> apache1
http://site1.apache2.dev1.mydomain.com/ --> apache2
http://site1.litespeed.dev1.mydomain.com/ --> litespeed
http://site1.php5.dev1.mydomain.com/ --> php5/fcgi, nginx
the host dev2.mydomain.com could serve:
http://site1.apache1.dev2.mydomain.com/ --> apache1
http://site1.apache2.dev2.mydomain.com/ --> apache2
http://site1.litespeed.dev2.mydomain.com/ --> litespeed
http://site1.php5.dev2.mydomain.com/ --> php5/fcgi, nginx
and they could have identical configuration. This is important
because I want to keep the second wildcard (for "dev1/dev2"), so that
I can make a machine image to install on new computers.
But the wildcard doesn't work.
With nginx 0.6.0 I get this error:
2007/06/27 11:36:07 [emerg] 27966#0: invalid server name or wildcard
"*.apache1.*.mydomain.com" on 0.0.0.0:80
With 0.5.26 the configuration test "nginx -t -c nginx.conf" is OK but
it doesn't work - all requests are forwarded to apache 1, whatever
host name is requested.
Does anybody know whether this is possible?
Thanks very much for your help.
Best wishes,
Igor Clark.
--
Igor Clark // POKE // 10 Redchurch Street // E2 7DD // +44 (0)20 7749
5355 // www.pokelondon.com
We've gone sub-zero with the TopGear Cool Wall: http://
www.topgear.com/coolwall/
Hello,
pls. advice me.
I am receiving errors from nginx of this kind:
2007/06/25 13:10:57 [alert] 8995#0: *20640082 socket() failed (24: Too
many open files) while connecting to upstream, client: XXX.XX.XXX.XXX,
server: XXX.XXX.XXX.XXX, URL: "/", upstream:
"http://XXX.XXX.XXX.XXX:80/", host: "XXX.XXX.XXX.XXX"
What could be wrong ?
I am using nginx 0.6.0 and Centos 4.4.
Best regards,
Martin Minka
Hi Folks.
I'm new in this list, recently I setup my blog using nginx with Mongrel, it
is a Rails app, and work fine in my old pII 400 256RAM, running under
OpenBSD 4.1.
Now, I want to add support for perl and other modules, such as Template
Toolkit, CGI::Application, etc.
If any people already has success setup it on nginx please let me know and
how do it please.
at this point, me only can run normal CGI trough a FastCGI handler.
Best Regards.
--
Francisco Valladolid H.
-- http://blog.bsdguy.net - Perl, [Open-Net] BSD fan. --
Hi guys,
I have a complex one I can't work out, Im trying to upload files in nginx
with a php script, this files are normally in the realm or 40-100mb, Ive
changed the relevent settings in php to allow these files I have also
checked phpinfo to make sure they are being used (I used the same ones on an
apache server), in nginx I was orignally getting 413 messages so I have
added
"client_max_body_size 150m;"
Now here is my problem, when i try to upload a file that is larger then 8mb
in size, nginx is saying that the page is a normal 200 however it is not
passing the POST information or the FILE information to php they are just
blank, and of course it isn't uploading the file, anything under 8mb works
fine.
Any suggestions?
the script is a simple
copy($HTTP_POST_FILES['file']['tmp_name'],"/directory/".$HTTP_POST_FILES['file']['name']);
based script.
Kingsley Foreman
Technical Leader Content Services / Content Management Group
=============================================
Internode Systems Pty Ltd
PO Box 284, Rundle Mall 5000
Level 1, 132 Grenfell Street, Adelaide 5000
Phone: +61 8 8228 2978
Fax: +61 8 8235 6978
Web: http://www.internode.on.nethttp://games.internode.on.net
=============================================
Hi i was the one who mentioned the "X-LIGHTTPD-SID" feature @
http://wiki.codemongers.com/NginxFeatureRequests webpage
i looked over proxy_hide_header and that doesnt do what is required
bascialy as an example i have a php script like so:
----------------------------------
<?php
$session_id = '1234567890';
$file = '/tmp/10meg.file';
header( "X-LIGHTTPD-SID: $session_id );
header( "X-Accel-Redirect: $file");
?>
-----------------------------------
so therefore this script would send a test 10MB file to the client and the
session_id would be logged into the access-log
this is an incredibly usefull feature as the logs can be parsed later to
deduce how much bandwidth was used per session!
more on this (see last paragraph) @ this page:
http://trac.lighttpd.net/trac/wiki/Docs%3AModAccessLog#id3
Hi,
I was wondering how can I achieve the User Home Directories feature with
nginx just like apache has. For example, when I type in
http://my.server/~snowwhite/ - it will serve me the contents from
/home/snowwhite/public_html/ ?
Regards,
--
Huan, Truong
http://tnhh.info/
Hello
im new to this mailing list (and nginx)
im using opera (hope thats the right software) to write to this mailing
list
can someone reply so i know im on the right track? this is sorta confusing
:)
Thanks