nginx error: (99: Cannot assign requested address)

前端 未结 8 1036
挽巷
挽巷 2020-12-24 11:52

I am running Ubuntu Hardy 8.04 and nginx 0.7.65, and when I try starting my nginx server:

$ sudo /etc/init.d/nginx start

I get the followin

8条回答
  •  猫巷女王i
    2020-12-24 12:34

    As kirpit mentioned above you'll want to allow linux processes to bind to a local IP address:

    nano /etc/sysctl.conf
    
    # allow processes to bind to the non-local address
    net.ipv4.ip_nonlocal_bind = 1
    
    sysctl -p /etc/sysctl.conf
    

    Then you want to add the private ip address that is associated with your elastic ip and add that to your sites config:

    nano /etc/nginx/sites-available/example.com
    

    Reload nginx:

    service nginx reload
    

    All done!

提交回复
热议问题