Set error_page follow reverse proxy kind

killed nginx-forum at nginx.us
Thu Jul 19 06:18:08 UTC 2012


Hi everyone,
My Nginx server is Reverse Proxy and other Apache is web server
192.168.1.10 (nginx) ----> 192.168.1.20 (apache)

How can I config error_page when nginx configurated like as Reverse
Proxy? And below my config file:

#===================================
user nginx nginx;

worker_processes 2;
worker_rlimit_nofile 8192;

pid /var/run/nginx.pid;

events {
  worker_connections 1024;
}

http {
limit_req_zone $binary_remote_addr zone=antiddos:10m rate=10r/s;
    include       mime.types;
    default_type  application/octet-stream;

    log_format main '$remote_addr - $remote_user [$time_local] '
                    '"$request" $status  $body_bytes_sent
"$http_referer" '
                    '"$http_user_agent" "$http_x_forwarded_for"';

    server_tokens off;
    access_log  /var/log/nginx_access.log  main;
    error_log  /var/log/nginx_error.log debug;
    server_names_hash_bucket_size 64;
    sendfile on;
    tcp_nopush     on;
    tcp_nodelay    off;
    keepalive_timeout  30;

    proxy_buffering on;
    proxy_buffer_size 16k;
    proxy_buffers 100 8k;
    proxy_connect_timeout      60;
    proxy_send_timeout         60;
    proxy_read_timeout         60;

    server {
      listen 192.168.1.10:80 default rcvbuf=8192 sndbuf=16384
backlog=32000;
      server_name _ ;
      charset off;
      access_log  /var/log/nginx_host_general.access.log  main;
      location / {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://192.168.1.20;
        client_max_body_size       2m;
        client_body_buffer_size    8k;
        proxy_buffering     on;
        proxy_connect_timeout      90;
        proxy_send_timeout         90;
        proxy_read_timeout         120;
        proxy_buffer_size          16k;
        proxy_buffers              32 32k;
        proxy_busy_buffers_size    64k;
        proxy_temp_file_write_size 64k;
      }
    }
    include /usr/local/nginx/vhosts/*.conf;
}
#===================================

Thank you very much

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,228722,228722#msg-228722



More information about the nginx mailing list