Control Web Panel
WebPanel => Apache => Nginx => Topic started by: KatiaSisHost on September 29, 2020, 03:51:09 PM
-
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
-
Solved... it's very slow but... it's working. take much time to work.
-
Can I ask where about did you place this config? How did you get it working?
-
Hello!
there is in:
WebServer---> Settings----> WebServers COnf Editor
u need create a subdomain first (if u case of instead in a subdomain) else u need create a domain first.
after, reload nginx in dashboard!
Merry Christmas!