Welcome! Log In Create A New Profile

Advanced

Can the Localhost Listen to Multiple Ports?

Posted by 1924608 
Can the Localhost Listen to Multiple Ports?
June 11, 2013 06:30PM
Hello,
I'm rather new to Nginx and web servers in general, so please bear with me!

The project I am working on, I am trying to create a reverse proxy with Nginx. However, rather than it being a reverse proxy to Apache, I am looking for it to do so for static and dynamic Nginx servers. I'm under the impression that I can do this (if not something similar) by having different virtual hosts listening at different ports, so that I may proxy_pass from my initial server to the static and dynamic ones respectively.

I am currently trying to get Nginx virtual hosts to listen to multiple ports at the same time, yet having no luck. I had followed the steps listed here:
http://rajibpaudyal.com/nginx-in-multiple-ports-in-same-localhost
explaining how to duplicate your project in different virtual hosts, yet when I try to access localhost:81, localhost:82, etc, it acts as if the page doesn't exist. (Typical Chrome/Firefox "We cannot make a connection at this server..." message.)

My nginx.conf file regarding the server and listening:

server {
listen 80;
server_name localhost;
root html;
index index.html index.htm;
}

I have also tried putting in other server blocks listening to different ports with no avail.
I do reload Nginx before I test it every time.

I'm running this on Fedora 18 with Arch Linux.

If anyone could point me in the right direction, I'd super appreciate it! I feel like there must be a very obvious solution I am missing, or that I am misunderstanding what I am trying to accomplish.

Thanks.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 232
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready