I created a configuration file called nginxserver.conf to run two servers from the same server like so:
server {
listen 83;
listen [::]:83;
server_name u.myproject.com;
location / {
return 301 http://0.0.0.0:5000;
}
}
server {
listen 83;
listen [::]:83;
server_name t.myproject.com;
location / {
return 301 http://0.0.0.0:5001;
}
}
While a previous configuration file that allowed me to connect to each server from different ports worked, this version of the configuration file only seems to allow me to connect to http://0.0.0.0:5001. How do I fix this configuration file in order to let me use the servername of each server to connect to the respective ip address of each server while having both nginx servers run from the same port?
Edit, I have change the configuration file to say this:
server {
listen 83;
listen [::]:83;
server_name u.myproject.com;
location / {
return 301 http://127.0.0.1:5000;
}
}
server {
listen 83;
listen [::]:83;
server_name t.myproject.com;
location / {
return 301 http://127.0.0.1:5001;
}
}
However, typing u.myproject.com:83 or t.myproject.com:83 into the browser just gives me an error message saying Hmm. We're having trouble finding that site. We can't connect to the server at . in my browser, so the issue still isn't fixed.