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

My nginx.conf file has:

server {
    listen       80;
    listen       443;

    #charset koi8-r;

    #access_log  /var/log/nginx/host.access.log  main;
    root /var/www/mysite/current;
    index index.html index.php;

    location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
      expires max;
      log_not_found off;

    location / {
      try_files $uri $uri/ /index.php;

    location ~* \.php$ {
      include fastcgi.conf;

This works, except won't do SSL on port 443. Any idea why not?

share|improve this question
up vote 1 down vote accepted

You haven't set ssl_certificate or ssl_certificate_key, which I believe are required to actually use SSL. You can use self-signed certificates if you don't have one from a CA.

share|improve this answer
How do I get self-signed ones? – Shamoon May 2 '13 at 16:25

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.