Setting UP server_name to all domain

Hello, i have many dynamic domains, and i want to set up that all domains to one directory of my wordpress installation using easyengine.

I create wordpress not using domain name, but

ee site create mydirectory --wp;

and below my nginx configuration

server {

server_name mydirectory _;

access_log /var/log/nginx/mydirectory.access.log rt_cache; 
error_log /var/log/nginx/mydirectory.error.log;
root /var/www/mydirectory/htdocs;
index index.php index.html index.htm;
include common/php.conf;      
include common/wpcommon.conf;
include common/locations.conf;
include /var/www/mydirectory/conf/nginx/*.conf;

}

I can open any domain, but the domain name for permalink and also script, css url return to http://mydirectory/any-url-here

Anyone can help me? So when i access any domain name, it will return to itself domain.

etc : mydomain1.com/any-url-here mydomain2.com/any-url-here

There is this thread:

The user @seyntjim managed to accomplish exactly what you want. Perhaps he/she can tell you what was made to solve the issue.

I just added it to my ee proxy created site.

sub_filter 'text-to-be-replaced' new-text';
sub_filter_once off;