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 have the following system:
> - a machine doing NAT that sends all connections of port 9000 (testing
> purposes) to a machine turning nginx 4.14 at 192.168.1.21.
> - This machine sends the requests to 192.168.1.15, a machine running
> apache with mod_python and django.
>
> The forwarding works just great, but I would like the logs of Apache
> to use the client's IP, not 192.168.1.21, in order not to change
> anything for the different sites administrators.
>
> In order to do this, I've this configuration:
>
> server {
> listen 80;
> server_name www.mysite.com;
> # vhost specific logs
> access_log /var/log/nginx/www.mysite.com.access.log combined;
>
> #Set the max size for file uploads to 50Mb
> client_max_body_size 50M;
>
> location / {
> proxy_pass http://192.168.1.15;
> proxy_redirect off;
> proxy_set_header Host $host;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
>
> set_real_ip_from 192.168.1.0/24;
> real_ip_header X-Real-IP;
> }
> }
>
> Is what i want to do possible? Does my approach make sense?
nginx passes a client address in X-Real-IP or X-Forwarded-For using
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
On Apache side you need to set mod_rpaf ( http://stderr.net/apache/rpaf/ )
On nginx side you do not need
set_real_ip_from 192.168.1.0/24;
real_ip_header X-Real-IP;
They do the same thing as mod_rapf for Apache.
> PS: Please include my mail address in your replies.
Igor Sysoev
http://sysoev.ru/en/
Hi-
Is there any way to get a config setting in nginx to turn off
buffering of file uploads to proxied backeds? I woudl really like to
be able to use mongrel_upload_progress to do upload progress bars in
rails applications. Right now there seems to not be a way to turn off
buffering of file uploads when the handler is a proxy backend.
Is there a way to turn this off? Coudl you please add one? Apache2.2
and lighty both support non buffered file uploads to proxied backends
and it would be great if nginx could support this as well.
Thank You-
-- Ezra Zygmuntowicz
-- Lead Rails Evangelist
-- ez(a)engineyard.com
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)
Hello there-
I am using a standard nginx config for proxying to mongrel for rails
apps. I have this for error pages:
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
But when my backend mongrels are down nginx always returns a 404
instead of a 500x error. Do I need to catch the 404 from proxy going
down and show my own error? Or is there something I am missing. Do
all failed proxy requests return 404 instead of 502 or 503?
Thanks-
-- Ezra Zygmuntowicz
-- Lead Rails Evangelist
-- ez(a)engineyard.com
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)
Hi,
I want to use some client certificates to act with my application user
db.
What I think is like this:
---
perl_set $pass MyAuthCheck;
location / {
if ($pass) {
.
fastcgi_pass ...
.
}
return 403;
}
---
MyAuthCheck(pseudo code):
---
.
.
if( select user from $DB where USER = mysql_quote($ssl_client_s_dn) ||
select user from $DB where USER = mysql_quote($ssl_client_i_dn)){
.
.
return OK;
}else {
.
.
return DECLINED;
}
---
Is it possible to get the
http://wiki.codemongers.com/NginxHttpSslModule
=> variables at the bottom of the site into perl?
As far as I have understand the perl-module there is the same problem as
in lighty with lua:
http://trac.lighttpd.net/trac/wiki/Docs%3AModMagnet#overview
---
Keep in mind that the magnet is executed in the core of lighty. EVERY
long-running operation is blocking ALL connections in the server.
---
Is this assumption right?
Thanks for help ;-)
Aleks
Hi,
I'm look for a way for Nginx to use Memcache as a storage for static HTML/images
On this page I found a reference:
http://article.gmane.org/gmane.comp.web.nginx.english/56/match=memcached
But what is "ngx_http_memcached_module" ? I cannot find any other references.
The reason I'm considering memcached is that I'm concerned about a
slow harddrive being a bottleneck. From what I understand, Nginx does
no caching at all?
Thanks for any tips :)
On Dec 27, 2006, at 5:37 AM, Franklin Kingma wrote:
> Hi list,
>
> With nginx is it possible to put the configuration for different
> virtual hosts in its own config file?
>
here is an extended example:
http://dev.2xlp.com/trac/wiki/NginxConfiguration
you must browse the actual svn repository to see how hosts and macros
are configured.
// Jonathan Vanasco
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
| FindMeOn.com - The cure for Multiple Web Personality Disorder
| Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
| RoadSound.com - Tools For Bands, Stuff For Fans
| Collaborative Online Management And Syndication Tools
Changes with nginx 0.5.5 24 Dec 2006
*) Change: the -v switch does not show compiler information any more.
*) Feature: the -V switch.
*) Feature: the "worker_rlimit_core" directive supports size in K, M,
and G.
*) Bugfix: the nginx.pm module now could be installed by an
unprivileged user.
*) Bugfix: a segmentation fault might occur if the $r->request_body or
$r->request_body_file methods were used.
*) Bugfix: the ppc platform specific bugs.
Igor Sysoev
http://sysoev.ru/en/