My nginx.conf file has:

server {
    listen       80;
    listen       443;
    server_name  www.mysite.com;

    #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?


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.

Your Answer

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

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