Forum: NGINX connect() to 127.0.0.1:80 failed (99: Cannot assign requested address

55043afa68f2bbafcb13f0a961b7927d?d=identicon&s=25 Atul Bansal (Guest)
on 2013-07-13 23:59
(Received via mailing list)
Hi

I just installed Nginx on my new VPS on centOS.
But while accessing the phpinfo.php, I am getting belwo exception

" connect() to 127.0.0.1:80 failed (99: Cannot assign requested address)
while connecting to upstream, client: 127.0.0.1,"

Can anyone pls see to it

--

Thanks'
Atul Bansal
TechOfWeb.com - Android Rooting
OceanOfWeb.com - Funny News
WordpressThemeIt.com <http://wordpressthemeit.com/> - Best Wordpress
Themes
http://twitter.com/techofweb <http://www.twitter.com/techofweb>
http://facebook.com/oceanofweb
27e6fb8c0fe4d1ad444b2a4967d1d6c5?d=identicon&s=25 Sajan Parikh (Guest)
on 2013-07-14 00:13
(Received via mailing list)
Attachment: NewNoppixEmailLogo.png (7 KB)
Attachment: smime.p7s (4 KB)
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
55043afa68f2bbafcb13f0a961b7927d?d=identicon&s=25 Atul Bansal (Guest)
on 2013-07-14 00:28
(Received via mailing list)
Thanks for stopping-by.
mailed you in seperate email. Pls see


On Sun, Jul 14, 2013 at 3:42 AM, Sajan Parikh <sajan@noppix.com> wrote:

> e: sajan@noppix.com
>
> OceanOfWeb.com - Funny News
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>



--

Thanks'
Atul Bansal
TechOfWeb.com <http://www.techofweb.com/> - Android Rooting
OceanOfWeb.com <http://www.oceanfweb.com/> - Funny News
WordpressThemeIt.com <http://wordpressthemeit.com/> - Best Wordpress
Themes
http://twitter.com/techofweb <http://www.twitter.com/techofweb>
http://facebook.com/oceanofweb
27e6fb8c0fe4d1ad444b2a4967d1d6c5?d=identicon&s=25 Sajan Parikh (Guest)
on 2013-07-14 00:40
(Received via mailing list)
Attachment: NewNoppixEmailLogo.png (7 KB)
Attachment: smime.p7s (4 KB)
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
55043afa68f2bbafcb13f0a961b7927d?d=identicon&s=25 Atul Bansal (Guest)
on 2013-07-14 00:45
(Received via mailing list)
Attachment: NewNoppixEmailLogo.png (7 KB)
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
55043afa68f2bbafcb13f0a961b7927d?d=identicon&s=25 Atul Bansal (Guest)
on 2013-07-14 00:48
(Received via mailing list)
Attachment: NewNoppixEmailLogo.png (7 KB)
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
55043afa68f2bbafcb13f0a961b7927d?d=identicon&s=25 Atul B. (atul_b)
on 2013-07-14 00:53
I dont think another nginx is already running as when I stopped my nginx
instance, i cannot see niginx running using the mentioned command...
The log error that i am getting is when I try to run any php file in my
browser.
However, for static html files, nginx is servig them fine
15eb13d662803f57bc4aea59704988b4?d=identicon&s=25 Scott Ribe (Guest)
on 2013-07-14 00:53
(Received via mailing list)
On Jul 13, 2013, at 4:48 PM, Atul Bansal wrote:

> The log error that i am getting is when I try to run any php file in my browser.

Are you trying to pass requests to PHP over port 80?

--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice
55043afa68f2bbafcb13f0a961b7927d?d=identicon&s=25 Atul B. (atul_b)
on 2013-07-14 00:55
(Received via mailing list)
ya


On Sun, Jul 14, 2013 at 4:22 AM, Scott Ribe
<scott_ribe@elevated-dev.com>wrote:

> http://www.elevated-dev.com/
> (303) 722-0567 voice
>
>
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>



--

Thanks'
Atul Bansal
TechOfWeb.com <http://www.techofweb.com/> - Android Rooting
OceanOfWeb.com <http://www.oceanfweb.com/> - Funny News
WordpressThemeIt.com <http://wordpressthemeit.com/> - Best Wordpress
Themes
http://twitter.com/techofweb <http://www.twitter.com/techofweb>
http://facebook.com/oceanofweb
15eb13d662803f57bc4aea59704988b4?d=identicon&s=25 Scott Ribe (Guest)
on 2013-07-14 00:58
(Received via mailing list)
From nginx to something upstream? (That's what I meant.)

On Jul 13, 2013, at 4:54 PM, Atul Bansal wrote:

> --
> nginx@nginx.org
> WordpressThemeIt.com - Best Wordpress Themes
> http://twitter.com/techofweb
> http://facebook.com/oceanofweb
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx


--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice
55043afa68f2bbafcb13f0a961b7927d?d=identicon&s=25 Atul B. (atul_b)
on 2013-07-14 01:02
(Received via mailing list)
Actually, I just bought a new unmanaged VPS. I installed php, nginx
etc...

I increased worker_connections, worker_rlimit_nofile, worker_processes
as
it was giving me some "low worker_connections" issue.

After I increased these limits, that issue resolved but now this issue
coming

Googled and implemented some changes based on that research but no
fruitful
result.

Stull getting the error as mentioned in subject


On Sun, Jul 14, 2013 at 4:27 AM, Scott Ribe
<scott_ribe@elevated-dev.com>wrote:

> >
> >
> > --
> > nginx@nginx.org
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>



--

Thanks'
Atul Bansal
TechOfWeb.com <http://www.techofweb.com/> - Android Rooting
OceanOfWeb.com <http://www.oceanfweb.com/> - Funny News
WordpressThemeIt.com <http://wordpressthemeit.com/> - Best Wordpress
Themes
http://twitter.com/techofweb <http://www.twitter.com/techofweb>
http://facebook.com/oceanofweb
15eb13d662803f57bc4aea59704988b4?d=identicon&s=25 Scott Ribe (Guest)
on 2013-07-14 01:09
(Received via mailing list)
Are you getting requests in nginx over port 80, then trying to pass them
to some PHP process over port 80?

On Jul 13, 2013, at 5:01 PM, Atul Bansal wrote:

>
> >
> >
> >
> > http://mailman.nginx.org/mailman/listinfo/nginx
>
> Atul Bansal
> TechOfWeb.com - Android Rooting
> OceanOfWeb.com - Funny News
> WordpressThemeIt.com - Best Wordpress Themes
> http://twitter.com/techofweb
> http://facebook.com/oceanofweb
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx


--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice
55043afa68f2bbafcb13f0a961b7927d?d=identicon&s=25 Atul B. (atul_b)
on 2013-07-14 01:13
(Received via mailing list)
I dont know what i am doing :(

As I said, i did what i mentioned above and now I just need to test what
I
am doing.... I referred google for setup..

After installing php mysql nginx... I just echoed some text and it gives
me
this error in log files


On Sun, Jul 14, 2013 at 4:39 AM, Scott Ribe
<scott_ribe@elevated-dev.com>wrote:

> >
> wrote:
> > >
> > >
> > > --
> > > nginx@nginx.org
> >
> > Thanks'
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>



--

Thanks'
Atul Bansal
TechOfWeb.com <http://www.techofweb.com/> - Android Rooting
OceanOfWeb.com <http://www.oceanfweb.com/> - Funny News
WordpressThemeIt.com <http://wordpressthemeit.com/> - Best Wordpress
Themes
http://twitter.com/techofweb <http://www.twitter.com/techofweb>
http://facebook.com/oceanofweb
15eb13d662803f57bc4aea59704988b4?d=identicon&s=25 Scott Ribe (Guest)
on 2013-07-14 02:28
(Received via mailing list)
On Jul 13, 2013, at 5:12 PM, Atul Bansal wrote:

> I dont know what i am doing :(

Everybody's got to start from 0 some time...

> As I said, i did what i mentioned above and now I just need to test what I am
doing.... I referred google for setup..

I think you need to include your config file in your next message.

> After installing php mysql nginx... I just echoed some text and it gives me this
error in log files

You need to be more clear about what you're trying to do and how,
step-by-step. (There are lots of ways to do things, maybe more than you
know and that's why you're assuming you know what we mean by "run php"
or "echo text"...)



--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice
55043afa68f2bbafcb13f0a961b7927d?d=identicon&s=25 Atul B. (atul_b)
on 2013-07-14 05:22
(Received via mailing list)
*httpd.conf*
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen [::]:80 default_server ipv6only=on;


============================================================================

*default.conf*
#
# The default server
#
server {
    listen       80 default_server;
    server_name  domain.com www.domain.com;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm index.php;
    }

    error_page  404              /404.html;
    location = /404.html {
        root   /usr/share/nginx/html;
    }

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    location ~ \.php$ {
        proxy_pass   http://127.0.0.1;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
        root           html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        include        fastcgi_params;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}


===============================================================================

*nginx.conf*
# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

user              nginx;
worker_processes  4;

# set open fd limit to 30000
worker_rlimit_nofile 30000;

error_log  /var/log/nginx/error.log;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;

pid        /var/run/nginx.pid;


events {
    worker_connections  63000;
}


http {
    include       /etc/nginx/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"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    # Load config files from the /etc/nginx/conf.d directory
    # The default server is in conf.d/default.conf
    include /etc/nginx/conf.d/*.conf;

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


On Sun, Jul 14, 2013 at 5:56 AM, Scott Ribe
<scott_ribe@elevated-dev.com>wrote:

>
> --
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>



--

Thanks'
Atul Bansal
TechOfWeb.com <http://www.techofweb.com/> - Android Rooting
OceanOfWeb.com <http://www.oceanfweb.com/> - Funny News
WordpressThemeIt.com <http://wordpressthemeit.com/> - Best Wordpress
Themes
http://twitter.com/techofweb <http://www.twitter.com/techofweb>
http://facebook.com/oceanofweb
7eafdd9fe337be7e8443caae46b76f9d?d=identicon&s=25 John Doe (Guest)
on 2013-07-15 12:31
(Received via mailing list)
From: Atul Bansal <oceanofweb@gmail.com>

>httpd.conf
>Listen [::]:80 default_server ipv6only=on;
>
>default.conf
>  listen    80 default_server;
>    proxy_pass  http://127.0.0.1;
>    fastcgi_pass  127.0.0.1:9000;


So, apache listens on ipv6 :80 and

nginx tries to listen on ipv4/v6 :80 and pass to ipv4 :80 ?
I think something is wrong...
Do you need apache at all?
Can you describe your processing chain?
=> nginx => php-cgi ?


JD
55043afa68f2bbafcb13f0a961b7927d?d=identicon&s=25 Atul B. (atul_b)
on 2013-07-15 12:45
(Received via mailing list)
I want to run wordpress sites on this server. The processing sud be fast
and efficient. Websites sud be able to open up speedly. So, pls suggest
me
anything here.

Thanks
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2013-07-15 13:12
(Received via mailing list)
Hello!

On Sun, Jul 14, 2013 at 12:53:27AM +0200, Atul B. wrote:

> I dont think another nginx is already running as when I stopped my nginx
> instance, i cannot see niginx running using the mentioned command...
> The log error that i am getting is when I try to run any php file in my
> browser.
> However, for static html files, nginx is servig them fine

The message suggests you've either run out of local sockets/ports,
or connections are administratively prohibited.  You may try unix
sockets to see if it helps.

--
Maxim Dounin
http://nginx.org/en/donation.html
2154be8b4430488454f0a067e09863b9?d=identicon&s=25 Ruslan Ermilov (Guest)
on 2013-07-15 13:45
(Received via mailing list)
On Sun, Jul 14, 2013 at 12:53:27AM +0200, Atul B. wrote:
> I dont think another nginx is already running as when I stopped my nginx
> instance, i cannot see niginx running using the mentioned command...
> The log error that i am getting is when I try to run any php file in my
> browser.
> However, for static html files, nginx is servig them fine

The error you see is when a local port range gets exhausted
for the (src=127.0.0.1, dst=127.0.0.1:80) triple.

This is because there's no Apache listening on 127.0.0.1:80,
so nginx proxies request to itself in an endless loop.
55043afa68f2bbafcb13f0a961b7927d?d=identicon&s=25 Atul B. (atul_b)
on 2013-07-15 13:52
(Received via mailing list)
Ok... So please suggest solution here..
I need to setup sites on nginx so tht processing of sites sud b fast

Much Thanks

Thanks'
Atul Bansal
www.techofweb.com
www.wordpressthemeit.com
www.oceanofweb.com
55043afa68f2bbafcb13f0a961b7927d?d=identicon&s=25 Atul B. (atul_b)
on 2013-07-15 15:12
(Received via mailing list)
Hi

Any helps here

Thanks'
Atul Bansal
www.techofweb.com
www.wordpressthemeit.com
www.oceanofweb.com
4596565da93d8664ecc08d747042b9a3?d=identicon&s=25 "Adrián Navarro" <adrian@navarro.at> (Guest)
on 2013-07-15 15:17
(Received via mailing list)
Remove the proxy_pass and its section altogether.

Your config has duplicate routing: first a proxy_pass (apache? But to
itself) then a fastcgi route.

If you want pure nginx, remove the location..part with the proxy pass
and reboot nginx.
Sent from my BlackBerry
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2013-07-15 15:21
(Received via mailing list)
Hello!

On Mon, Jul 15, 2013 at 06:41:59PM +0530, Atul Bansal wrote:

> Any helps here

You should actually start Apache on your server - to do so on
Linux you have to configure it to listen on a port different from
one nginx is listening on (or to configure nginx to listen on an ip
address instead of *).

--
Maxim Dounin
http://nginx.org/en/donation.html
7e5b9e3ef674f859551ae0e283061b52?d=identicon&s=25 Jim Ohlstein (Guest)
on 2013-07-15 15:26
(Received via mailing list)
On 7/15/13 7:51 AM, Atul Bansal wrote:
> Ok... So please suggest solution here..
> I need to setup sites on nginx so tht processing of sites sud b fast
>

I mean no disrespect, but the solution is to get a competent sysadmin.
This can all be fixed in about 5-10 minutes. Your configuration is
*completely* wrong, you're trying to run two web servers which are
competing for ::80, you have a fastcgi_pass and a proxy_pass statement
in the same location, and the list goes on. People are giving you advice
that you clearly do not understand.

First thing you need to do is get Apache stopped (or at least not
listening on port 80), and prevent it from restarting. If you think
Apache is not running, run this command and show the output:

# ps aux | grep httpd

Next, use Google to learn how to stop Apache and prevent it from
restarting on each reboot.

After that, again go back to Google and learn how to write a proper
nginx.conf (generically and for WordPress). Then decide how you're going
to handle PHP requests and set up the proper daemon to run at boot. Same
thing with nginx.

Now I've given you a roadmap. This is not an "nginx for dummies" mailing
list. You need to do some of the work yourself.

--
Jim Ohlstein
55043afa68f2bbafcb13f0a961b7927d?d=identicon&s=25 Atul B. (atul_b)
on 2013-07-15 15:33
(Received via mailing list)
Thanks.. So, which option should I go here:
1. Install only Nginx and remove Apache completely
2. Http request will be from Apache to Nginx
3. Http request will be from Nginx to Apache.
4. Any other best way

Thanks'
Atul Bansal
www.techofweb.com
www.wordpressthemeit.com
www.oceanofweb.com
4596565da93d8664ecc08d747042b9a3?d=identicon&s=25 "Adrián Navarro" <adrian@navarro.at> (Guest)
on 2013-07-15 15:45
(Received via mailing list)
Given how lost you are I'd say go with Apache altogether, and forget
nginx, as you'll have to deal with wp-specific config later on. And you
seem pretty much lost.

But if you want to stick to nginx, go with a correct configuration:
forget apache and remove the proxy_pass.

And if you want to use nginx+apache , then learn using the wiki and
learn how it should work and why things are done that way. You don't
seem to understand even half of it :(

Sent from my BlackBerry
7eafdd9fe337be7e8443caae46b76f9d?d=identicon&s=25 John Doe (Guest)
on 2013-07-15 15:54
(Received via mailing list)
From: Atul Bansal <oceanofweb@gmail.com>

>On Jul 15, 2013 4:01 PM, "John Doe" <jdmls@yahoo.com> wrote:
>>Do you need apache at all?
>>Can you describe your processing chain?
>>=> nginx => php-cgi ?
>I want to run wordpress sites on this server. The processing sud be
fast and efficient. Websites sud be able to open up speedly. So, pls
suggest me anything here.


So... your setup is... "sud be
fast and efficient. Websites sud be able to open up speedly"...
You are not describing your setup.
Who receives the requests? nginx? apache?
To which one are the requests forwarded? nginx? apache+php? php-cgi?
Why apache?

Just repeating that it "sud be fast" is not helpful at all...
If you do not describe your current setup, people won't be able (or
willing) to help you.


JD
2974d09ac2541e892966b762aad84943?d=identicon&s=25 brainchill (Guest)
on 2013-07-22 18:22
(Received via mailing list)
Everyone is telling this guy that he's clueless but the bottom line is
the
very first guy that answered the question nailed it ...

"The message suggests you've either run out of local sockets/ports,
or connections are administratively prohibited. You may try unix
sockets to see if it helps."

Try setting
kernel option  net.ipv4.ip_local_port_range to 1024 65000

The default setting is 32768 61000

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,240816,241121#msg-241121
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2013-07-22 18:52
(Received via mailing list)
Hello!

On Mon, Jul 22, 2013 at 12:21:44PM -0400, brainchill wrote:

> The default setting is 32768 61000
Not really.  The real problem seems to be outlined by Ruslan -
due to no Apache running nginx is essentially configured to proxy
to itself, and adding more sockets won't help - they will be
exhaused as well due to the proxy loop.

--
Maxim Dounin
http://nginx.org/en/donation.html
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.