I have dozens of undeveloped domains and I want them to display the same .php file for all of them by just pointing them to the same DNS:

ns1.example.com ns2.example.com

Both NS are pointing to my VPS IP address but pages are not working.

I want that any domain I configure with that DNS point to the VPS and display the same php file automatically.

I have Ubuntu Server 16.04 + nginx + php-fpm working fine.

How can I achieve this by just configuring nginx? Is it necessary to configure Bind? How?

Thanks in advance,



You can create a default server without specifying server name, it will respond to every domain that's not explicitly set in other server blocks.

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /var/www/html;
    server_name _;

    #your php config

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.