POST Requests and Proxy Behavior

Andy Madsen amadsen at gmail.com
Thu Feb 25 07:40:30 MSK 2010


Hi Everyone:

I have a two webservers running nginx behind a load balancer. These two 
webservers are proxying SSL content from an app server on the LAN 
address that is not on the load balancer. Configuration is below:

==================================================
server {
 listen       443;
 server_name  some.domain.com;

 ssl                  on;
 ssl_certificate      /path/to/some_cert.pem;
 ssl_certificate_key  /path/to/some_key.pem;

 access_log  /var/log/httpd/nginx_ssl_access_log main;
 #access_log off;
 error_log  /var/log/httpd/nginx_ssl_error_log;

 charset utf-8;

 location / {
 
  if (-f $request_filename) {
    expires max;
    break;
  }
 
  if ($request_filename !~ "\.(js|htc|ico|gif|jpg|png|css)$") {
    proxy_pass https://192.168.2.1;
  }
   
 }

}
=================================================


This works very well for all GET requests, but if I try to post from a 
non-ssl machine to the load balancer, the proxy tries to serve a file 
using the LAN address, and obviously fails at https://192.168.2.1. Is 
there something I'm missing in the reverse proxy for a POST request in 
my configuration? I haven't been able to find any specific documentation 
about why a POST wouldn't work, and GET would.

NGINX is great!

Thanks
Andy





More information about the nginx mailing list