Default domain for server IP

Is it possible for requests using public server IP like http://12.12.12.12/ to go to http://domain.com/ installed on that server?

I guess that is what you are asking about!

No, that is not what I’m looking for.

I have a server with 3 domains on it, but when I open http://12.12.12.12/ I want to go on one of those domains installed - so I want to define a default domain for the server IP

So basically you want only one domain to be available at the server ip. You need to set the DNS records for those under hestiacp. However, I am guessing you already have the hestia control panel installed at the IP:Port of 12.12.12.12:8083. So, just login to hestia control panel, and set the DNS record for the added domain that you want to be available/exposed at the IP.

Panel login > select packages > ensure your nameserver is setup properly (example ns1.domain.tld, ns2.domain.tld).

Panel Logged in > Add user under the user tab (do not use admin/root user) > add the needed domain under that user (select DNS for DNS & email if you need email as well) > okay > wait for 10-15 minutes, and your selected domain would be available at the domain you provided for.

What I did is the following:

On nginx I’ve edited /etc/nginx/conf.d/12.12.12.12.conf

I’ve changed the original content (requests coming on ip on port 80 were going to apache on port 8080)

server {
        listen 12.12.12.12:80 default_server;
        server_name _;
        access_log off;
        error_log /dev/null;

        location / {
                proxy_pass  http://12.12.12.12:8080;
   }
}

and i’ve put a 307 redirect (301 redirect will transform POST requests to GET on final destination)

server {
        listen 12.12.12.12:80 default_server;
        server_name _;
        access_log off;
        error_log /dev/null;

        location / {
                return 307 $scheme://domain.com$request_uri;
   }
}

It does what I want and I’m happy BUT I wonder if this is going to be lost when upgrading hestiaCP