0

nginx on Mac OS X is running via brew successfully on ports 80 and 443.

However, I am trying to run on a different port 18000 and nginx does not want to respond, despite listening to the port.

server {
    listen       18817 ssl;
    server_name  example.com www.example.com;

    location / {
        proxy_pass       https://www.new-server.com/;
        proxy_redirect   https://www.new-server.com https://www.example.com;
}

I can see the port is being listening on netstat -na | grep LISTEN | grep 18000:

tcp4       0      0  *.18000                *.*                    LISTEN 

sudo lsof -i :18000 shows the port is being listened on as well by nginx:

nginx     71351       root   11u  IPv4 0x78e8667283110347      0t0  TCP *:18000 (LISTEN)
nginx     71359     nobody   11u  IPv4 0x78e8667282110647      0t0  TCP *:18000 (LISTEN)

Yet the access logs do not show anything when I run curl -k https://example.com:18000. Nothing shows up in the error log when I start up nginx after setting the config above.

How can I further debug this?

  • What does curl -v -k https://example.com:18000 produce? – Mark Wagner Feb 15 at 0:10
  • 1
    Have you configured DNS or /etc/hosts to resolve example.com to your host? – Alexey Ten Feb 15 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.