1

I had Ngxin working just fine. But now I want to change my site to another port. I tried with my Drupal site and my bare-bone php script site. Both not working.

My vhost is simple.

server
{
  listen       81;
  server_name  wiki.domain.com;
  index        index.php index.html index.htm;
  root         /opt/www/domain_wiki;
  error_page 404 = @drupal;

  location @drupal {
     rewrite ^/(.*)$ /index.php?q=$1 last;
  }

  location ~ .*\.(php|php5)?$
  {
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
    include       fastcgi.conf;
  }
  access_log logs/domain_wiki.log main;
}

What I did is only changing 80 to 81.

I tried to test the port. It seems just fine.

# nc -z localhost 81
Connection to localhost 81 port [tcp/hosts2-ns] succeeded!

I restart, reload, -t Nginx. All fine.

Ideas?

# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:http
RH-Firewall-1-INPUT  all  --  anywhere             anywhere

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
RH-Firewall-1-INPUT  all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain RH-Firewall-1-INPUT (2 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     icmp --  anywhere             anywhere            icmp any
ACCEPT     esp  --  anywhere             anywhere
ACCEPT     ah   --  anywhere             anywhere
ACCEPT     udp  --  anywhere             224.0.0.251         udp dpt:mdns
ACCEPT     udp  --  anywhere             anywhere            udp dpt:ipp
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ipp
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTAB                                 LISHED
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:f                                 tp
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:s                                 sh
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:h                                 ttps
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:h                                 ttp
REJECT     all  --  anywhere             anywhere            reject-with icmp-ho                                 st-prohibited
Hao
  • 515
  • 2
  • 7
  • 17

2 Answers2

0

Do you have a firewall? Do you have something else listening on port 81? Are you running SELinux?

There is nothing in nginx that would cause problems like this, so you're looking for something at the OS level.

devicenull
  • 5,572
  • 1
  • 25
  • 31
0

Make sure the iptables rules allow traffic in to your machine on TCP/81 aswell.

For example:

Allow traffic in from anyone

iptables -I INPUT -p tcp --dport 81 -j ACCEPT
norrland
  • 103
  • 9