Posted on: January 29, 2020 12:18 PM
Posted by: Renato
Views: 384
Configurações para usar subdomains
NGINX SUBDOMAINS
My domain.com has IP y.y.y.y and accepts requests on port 80
My subdomains are:
- admin.domain.com -> I need to proxy to x.x.x.x:3434
- user.domain.com -> I need to proxy tox.x.x.x:3435
- vendor.domain.com -> I need to proxy to x.x.x.x:3436
server {
listen 80;
server_name admin.domain.com;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:3434;
proxy_redirect off;
}
}
server {
listen 80;
server_name user.domain.com;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:3435;
proxy_redirect off;
}
}
server {
listen 80;
server_name vendor.domain.com;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:3436;
proxy_redirect off;
}
}
Donate to Site
Renato
Developer