Hello i have a CWP in a 192.168.1.100 and i have other server with 192.168.1.101
i have the domain xxxx.com and the subdomain myapp.xxxx.com and api.xxxx.com.... how add a reverse proxy to 192.168.1.101?
i have changed the apache for apache & Nginx... i have a xxxx.com domain working in a cwp... in what file add this?
server {
server_name myapp.mydomain.com;
location / {
proxy_pass
http://192.168.1.101:3333; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache_bypass $http_upgrade;
}
}
and
server {
server_name api.mydomain.com;
location / {
proxy_pass
http://192.168.1.101:8080; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache_bypass $http_upgrade;
}
}
i added this code in same files and when enter a myapp.xxxx.com and api.xxxx.com only see the TEST PAGE