I am trying to write an nginx.conf
which will redirect to port 3001 where meteor.js
TEST env is of my EC2 instance. If user types "xxx.xxxx.com/test". Redirection isn't working and it searches pages from my meteor.js
app.
Nginx
and meteor.js
app are in docker
containers.
nginx.conf:
events{
}
http{}
server {
listen *:80;
server_name xxxxx.xxxx.com www.xxxxx.xxxx.com;
location / {
proxy_pass http://xxxxx.xxxx.com:3000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /test/ {
proxy_pass http://xxxxx.xxxx.com:3001;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}
How to make a proper redirection(I am very new to nginx). Thank you in advance!