Welcome! Log In Create A New Profile

Advanced

How to listen to same domain on mutiple IPs

Posted by miradev 
How to listen to same domain on mutiple IPs
October 30, 2009 11:59AM
Rackspace's network setup means that public IPs are not visible locally. This means that if I happen to use a domain name that resolves to the same machine as he box, it requires manually adding to /etc/hosts. Usually as localhost.

Not wanting to duplicate myself, I was hoping to setup a particular service under a different port and proxying from the public IP to the localhost. But I am missing something?

[code]
server {
listen 216.239.159.104:8081;
server_name appsever.domain.com;

root /var/www/appserver;

access_log /var/log/nginx/apps-public-access.log;
error_log /var/log/nginx/apps-public-error.log;

index index.html;

location / {
proxy_pass http://127.0.0.1:8081;
}
}

server {
listen 127.0.0.1:8081;
server_name appsever.domain.com;

root /var/www/appserver;

access_log /var/log/nginx/apps-local-access.log;
error_log /var/log/nginx/apps-local-error.log;

index index.html;
}
[/code]
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 318
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready