Configure nginx to receive any domain

1

I have this configuration in nginx that any domain that is pointed out on my server it accesses the folder with the domain name.

My question is how do I get my clients to point their domain to my server only in a single folder.

Example: my site is www.meudominio.com, when it points to my site it accesses the friendly URL of it type www.meudominio.com/user , as if it were a virtual store service type hostgator , right now Thanks for the help!

server {
    listen 80;
    server_name   ~^(www\.)?(?<domain>.+)$;
    root   /usr/share/nginx/html/$domain;
    port_in_redirect off;
    index index.html index.php;
    location / {
        charset utf-8;
        if (!-e $request_filename) {
        rewrite ^.*$ /index.php last;       
        }
    }   
    location /url/ {
        if (!-e $request_filename) {
        rewrite ^(.*)$ /url/index.php?url=$1 last;      
        }
    }   
    rewrite /wp-admin$ $scheme://$host$uri/ permanent;
    location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
        access_log off; log_not_found off; expires max;
    }
    location ~ [^/]\.php(/|$)  {
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {
            return      444;
        }
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
        fastcgi_buffer_size 128k;
        fastcgi_buffers 256 16k;
        fastcgi_busy_buffers_size 256k;
        fastcgi_temp_file_write_size 256k;
        include fastcgi_params;
        fastcgi_param   SERVER_PORT 80;
    }
}
    
asked by anonymous 21.08.2015 / 19:40

1 answer

-1

I believe they will have to make an alias (CNAME) in the DNS of their domain for your domain. Here is an example in the Registry.br.

.

    
13.08.2017 / 05:23