Hello
I am having trouble setting up the following configuration.
domain.com - nginx (reverse proxy) -> Apache ---- This works, no issues
myapp.domain.com - nginx (reverse proxy) -> Nodejs ---- This setup doesn't work.
Here are the things which I tried.
My app works as subfolder (by adding "location /myapp" and proxy directives in Plesk web server settings -> nginx directives )
domain.com/myapp - nginx (reverse proxy) -> Nodejs --- works
But I want it at the subdomain root level. So I created a subdomain in plesk and I tried the "location /" in nginx directive, but I am getting duplicate location.
So I deleted the subdomain and tried the server directive in /etc/nginx/conf.d/myapp.conf as follows,
What I am getting is plesk default web page and not my app page. My subdomain DNS is also setup to point to main domain's ip address.
So how do I achieve this setup? Please help.
I am having trouble setting up the following configuration.
domain.com - nginx (reverse proxy) -> Apache ---- This works, no issues
myapp.domain.com - nginx (reverse proxy) -> Nodejs ---- This setup doesn't work.
Here are the things which I tried.
My app works as subfolder (by adding "location /myapp" and proxy directives in Plesk web server settings -> nginx directives )
domain.com/myapp - nginx (reverse proxy) -> Nodejs --- works
But I want it at the subdomain root level. So I created a subdomain in plesk and I tried the "location /" in nginx directive, but I am getting duplicate location.
So I deleted the subdomain and tried the server directive in /etc/nginx/conf.d/myapp.conf as follows,
Code:
server {
listen 0.0.0.0:80;
server_name myapp.domain.com;
access_log /var/log/nginx/myapp.log;
location / {
proxy_pass http://127.0.0.1:38600/;
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-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_cache_bypass $http_upgrade;
}
}
So how do I achieve this setup? Please help.