How can I bind a process to a floating IP?

How can I bind a process(i.e. Web server) to a floating IP address? I want to configure NGINX to listen only on the floating IP. However, Ubuntu doesn’t detect the floating IP at all, and NGINX gives an error whenever I try:

nginx: [emerg] bind() to floating_ip:443 failed (99: Cannot assign requested address)

The config I’m using is:

        listen floating_ip:443 ssl;
        ssl_certificate /var/www/;
        ssl_certificate_key /var/www/;
        location /{
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
            #proxy_set_header scheme $scheme;
            proxy_set_header X_FORWARDED_PROTO $scheme;
Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Thanks to X40C for finding this:

The answer already exists here.


Run the following from your droplet to find the IP to bind to:

curl -s