Nginx Architecture in deep

António P. P. Almeida appa at perusio.net
Sat Jun 4 20:08:37 MSD 2011


On 4 Jun 2011 05h26 WEST, nginx-forum at nginx.us wrote:

> Thanks appa. 
>
> My question is: if the setup works with two ports, how come it stops
> working when the ports are switched? 
>
> Anyway, my config: 
>
>
> proxy_cache_path /dev/shm/proxy_cache levels=1:2
> keys_zone=proxyone:10m inactive=10m max_size=100m;
> proxy_cache_key "$scheme$host$request_uri$cookie___user";
>
> proxy_cache             proxyone;
> proxy_cache_min_uses    1;
> proxy_cache_valid       any 60s;  
> proxy_cache_valid       404 0s;   
> proxy_cache_valid       500 502 503 504 1s;
>
>
> #>>>>>>>>>>>>>>>>>>>>>>>>>>>>> SERVER BLOCK
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> server
> {
> listen 77.12.16.8:89;
> server_name     mydomain.com   www.mydomain.com;
>
> root /home/mydomain/public_html;
> index index index.php index.html;
>
> error_page 403 = @backend;
> error_page 404 = @backend;
> error_page 406 = @backend;
> error_page 500 = @backend;

Are you sure you want to "ignore" internal server errors and instead
forward the request to the backend?

Note that as you have it right now the 500 status code will always be
returned even if the request is forwarded.

> location / { location
> ~.*\.(gif|jpg|png|ico|swf|rss|xml|htm|txt|js|css|gz|doc|xls|pdf)$ {
> expires max; try_files $uri @backend; log_not_found off; }
> proxy_pass http://77.12.16.8:80; include proxy.inc; }
>
> location @backend {

> internal;
^^^^^^^^^^^

Named locations are "already" internal. 
Cf. http://wiki.nginx.org/HttpCoreModule#location

> proxy_pass http://77.12.16.8:80;
> include proxy.inc;
> }
>
> }  # End of server block 

> ### RPAF STUFF FOR NGINX PROXYING
> LoadModule rpaf_module modules/mod_rpaf-2.0.so
> RPAFenable On
> RPAFproxy_ips 127.0.0.1  77.12.16.8
> RPAFsethostname On
> RPAFheader X-Real-IP

I suspect that the problem is somewhere in your Apache
configuration. Try stoping both servers and starting them
again. Observe if the sockets are created and that each daemon is
listening on its respective address.

lsof -i tcp or nestat -t -l

--- appa



More information about the nginx mailing list