# Nginx is not responding for android mobile using org.apache.http Post Request

**URL:** <https://www.ruby-forum.com/t/nginx-is-not-responding-for-android-mobile-using-org-apache-http-post-request/186346>\
**Category:** NGINX\
**Created:** [April 5, 2010, 12:24pm UTC](https://www.ruby-forum.com/t/nginx-is-not-responding-for-android-mobile-using-org-apache-http-post-request/186346 "2010-04-05T12:24:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/94ad74/32.png) [@Bala](https://www.ruby-forum.com/u/Bala)\
**Post date:** [April 5, 2010, 12:24pm UTC](https://www.ruby-forum.com/t/nginx-is-not-responding-for-android-mobile-using-org-apache-http-post-request/186346/1 "2010-04-05T12:24:42Z")

</div>

Hi,

I am newbie to Nginx. I am running my ruby on rails application with  
nginx and mongrel cluster. when i send the http POST request from  
android mobile native app, i am not able to get the response. but for  
GET request i am able to get the response properly.

i have tried following also

```
  if ($request_method !~ ^(GET|POST|HEAD)$ ) {
     return 444;
  }

```

still i am not able to get it work done.

What could be the problem?

Note : when i run my application in single port without nginx. i am able  
to get the response properly. so i suspect that the problem exist in the  
nginx configuration.

Please anybody help me to fix this issue.

Regards,  
Bala.

Posted at Nginx Forum:

> **[Nginx is not responding for android mobile using org.apache.http Post Request](https://forum.nginx.org/read.php?2,71360,71360#msg-71360)**
>
> Hi, I am newbie to Nginx. I am running my ruby on rails application with nginx and mongrel cluster. when i send the http POST request from android mobile native app, i am not able to get the response. but for GET request i am able to get the response...

---

<div class="post-metadata">

**Author:** ![Bala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/94ad74/32.png) [@Bala](https://www.ruby-forum.com/u/Bala)\
**Post date:** [April 5, 2010, 5:53pm UTC](https://www.ruby-forum.com/t/nginx-is-not-responding-for-android-mobile-using-org-apache-http-post-request/186346/2 "2010-04-05T17:53:37Z")

</div>

On Mon, 2010-04-05 at 06:23 -0400, Bala wrote:

> so i suspect that the problem exist in the nginx configuration.

So maybe you should post your configuration?

Cliff

---

<div class="post-metadata">

**Author:** ![Bala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/94ad74/32.png) [@Bala](https://www.ruby-forum.com/u/Bala)\
**Post date:** [April 5, 2010, 7:06pm UTC](https://www.ruby-forum.com/t/nginx-is-not-responding-for-android-mobile-using-org-apache-http-post-request/186346/3 "2010-04-05T19:06:46Z")

</div>

## Cliff W. Wrote:

> So maybe you should post your configuration?

Well the following is my configuration :

# Server Configuration

Processor : 2x AMD Quad core 2382 @ 2.70Hz

Ram : 32GB memory

OS : CentOS release 5.3 (Final)

# Nginx Version

nginx version: nginx/0.7.65  
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-46)  
configure arguments: --with-poll\_module --with-select\_module  
–with-rtsig\_module

# Sample Configuration File

# user and group to run as

user root;

# number of nginx workers

worker\_processes 2;

# pid of nginx master process

pid /var/run/nginx.pid;

# Number of worker connections. 1024 is a good default

events {  
worker\_connections 4000;  
#use poll;  
multi\_accept on;  
accept\_mutex on;  
accept\_mutex\_delay 50ms;  
epoll\_events 1024;  
}

# start the http module where we config http access.

http {

# pull in mime-types. You can break out your config

# into as many include’s as you want to make it cleaner

include /usr/local/nginx/conf/mime.types;

# set a default type for the rare situation that

# nothing matches from the mimie-type include

default\_type application/octet-stream;

charset utf-8;  
source\_charset utf-8;  
clinet\_header\_buffer\_size 40k;  
large\_clinet\_header\_buffers 4 30k;

# configure log format

log\_format main '“Status” $status “Bytes” $bytes\_sent “u Addr:”  
$upstream\_addr “u status” $upstream\_status “U Response”

$upstream\_response\_time “MSec” $msec ';

log\_format error '“Status” $status “Bytes” $bytes\_sent “u Addr:”  
$upstream\_addr “u status” $upstream\_status “U Response”

$upstream\_response\_time “MSec” $msec ';

# main access log

#access\_log /var/log/nginx/nginx\_access.log main;  
access\_log off;

# main error log

error\_log /var/log/nginx/nginx\_error.log error;

# no sendfile on OSX

sendfile on;  
keepalive\_timeout 5;

# These are good default values.

tcp\_nopush on;  
tcp\_nodelay on;

# output compression saves bandwidth

gzip off;

client\_body\_timeout 1s;

upstream Sample {

server 127.0.0.1:9000;  
server 127.0.0.1:9001;  
server 127.0.0.1:9002;  
server 127.0.0.1:9003;  
server 127.0.0.1:9004;  
}

server {

listen 80;

client\_max\_body\_size 100M;

server\_name [www.sample.com](http://www.sample.com);

root /home/public;

location ~\*

^.+.(jpg|jpeg|JPG|JPEG|GIF|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov)$  
{  
root /home/public;  
expires 7d;

location / {  
proxy\_set\_header X-Real-IP $remote\_addr;  
if ($request\_method !~ ^(GET|POST|HEAD) {  
return 444;  
}

proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
proxy\_set\_header Host $http\_host;  
#proxy\_redirect off;  
proxy\_max\_temp\_file\_size 0;  
proxy\_connect\_timeout 30;  
break;  
proxy\_pass [http://Sample](http://Sample);  
}

Regards,  
Bala.

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,71360,71484#msg-71484](http://forum.nginx.org/read.php?2,71360,71484#msg-71484)
