Connect() to 127.0.0.1:80 failed (99: Cannot assign requested address

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

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.

Hello!

On Mon, Jul 15, 2013 at 06:41:59PM +0530, Atul B. 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 D.
http://nginx.org/en/donation.html

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 B.
www.techofweb.com
www.wordpressthemeit.com
www.oceanofweb.com

On 7/15/13 7:51 AM, Atul B. 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 O.

From: Atul B. [email protected]

On Jul 15, 2013 4:01 PM, “John D.” [email protected] 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

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 :frowning:

Sent from my BlackBerry

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:

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 D.
http://nginx.org/en/donation.html