Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm migrating some sites from Apache to Nginx and trying to get one configured to answer SSL requests. At the moment I'm getting a server not responding error. If I switch to port 80 I get an nginx error (not worried about the error itself since nginx is at least serving it up).

For this site, I want it to only answer ssl requests. Here's what the server block looks like:

server {
  listen      443;
  server_name dev.project.mydomain.net;
  root        /opt/dev/project-root;
  index       index.php;

  ssl                  on;
  ssl_certificate      /etc/ssl/certs/mycert.crt;
  ssl_certificate_key  /etc/ssl/certs/mycert.pem;

  access_log /var/log/nginx/vh.dev-project.access.log;
  error_log  /var/log/nginx/vh.dev-project.error.log;

  location /aliasing/ {
    alias /opt/dev/project-root/aliased;
  }

  # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  #
  location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;

    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    include fastcgi_params;
  }
}

Any insight would be much appreciated.

UPDATE

My http block:

http {
    include       /etc/nginx/mime.types;

    access_log  /var/log/nginx/access.log;

    sendfile        on;

    keepalive_timeout  65;
    tcp_nodelay        on;

    gzip  on;
    gzip_disable "MSIE [1-6]\.(?!.*SV1)";

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}
share|improve this question
    
Your server-block itself looks okay. Can you post the rest of your configuration? (E.g. nginx.conf) –  pkhamre Aug 16 '12 at 14:09
1  
And btw, since nginx 0.7.14 the preferred way of enabling SSL is by using the ssl parameter in the listen directive like this: listen 443 default_server ssl; –  pkhamre Aug 16 '12 at 14:10
    
Thanks for the insight. What is the default_server component? This is just one virtual host, so I want to be sure it's not doing anything outside of that scope. –  Rob Wilkerson Aug 16 '12 at 14:35
    
@pkhamre - Added my http block above. Any other config tips you may have are always welcome. Thanks again. –  Rob Wilkerson Aug 16 '12 at 15:04
add comment

1 Answer

up vote 1 down vote accepted

You have opened up port TCP443 on your firewall if you have one enabled, I hope? (It's an obvious one, but I've missed this before myself.)

share|improve this answer
    
You're close. The port was open, but not forwarding properly from the external router. Ugh. –  Rob Wilkerson Aug 17 '12 at 11:35
    
man, u saved my life! –  rizidoro Jun 21 '13 at 11:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.