Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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;
  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/;
  error_log  /var/log/nginx/;

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

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

    fastcgi_index index.php;
    include fastcgi_params;

Any insight would be much appreciated.


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
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
up vote 4 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

Your Answer


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.