Я нашел свой ответ и спасибо @ Patrick-Mevzek.
Я решил свою проблему, добавив следующие блоки серверов в мою конфигурацию nginx.
server {
listen 80 default_server;
listen [::]:80 default_server;
root /home/erfantahvieh.com/front;
server_name domain.example www.domain.example;
index index.html index.htm index.nginx-debian.html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
autoindex on;
autoindex_exact_size off;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
server {
listen 80;
root /home/erfantahvieh.com/admin;
server_name admin.domain.example www.admin.domain.example;
index index.html index.htm index.nginx-debian.html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
server {
listen 80;
root /usr/share/nginx/html;
server_name api.domain.example www.api.domain.example;
index index.html index.htm index.nginx-debian.html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://xxx.xxx.xxx.xxx:8080/;
}
}