upstream thirteen_production {
  server unix:///home/jesse/srv/thirteen-tien-len_production/shared/tmp/sockets/puma.sock fail_timeout=0;
}

server {
  server_name 13.whitewizardweb.com 13.24x7.hk 13.mounthoodlodge.com 13.my.to;
  root        /home/jesse/srv/thirteen-tien-len_production/current/public;
  access_log  /home/jesse/srv/thirteen-tien-len_production/shared/log/nginx.access.log;

  try_files         $uri @app;

  location @app {
     proxy_pass        http://thirteen_production;
     proxy_set_header  X-Real-IP  $remote_addr;
     proxy_set_header  X-Forwarded-Proto https;
     proxy_set_header  Host $http_host;
     proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_redirect    off;
     proxy_next_upstream error timeout invalid_header http_502;

     proxy_connect_timeout       600;
     proxy_send_timeout          600;
     proxy_read_timeout          600;
     send_timeout                600;

  }



#    listen 443 ssl; # managed by Certbot
#    ssl_certificate /etc/letsencrypt/live/13dev.quaff.top/fullchain.pem; # managed by Certbot
#    ssl_certificate_key /etc/letsencrypt/live/13dev.quaff.top/privkey.pem; # managed by Certbot
#    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
#    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/13.24x7.hk/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/13.24x7.hk/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


}

server {
    listen 80;
    listen [::]:80;
    server_name 13.whitewizardweb.com;
    return 301 https://13.whitewizardweb.com$request_uri;
}


server {
    if ($host = 13.24x7.hk) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


  listen 80;
  server_name 13.whitewizardweb.com 13.24x7.hk 13.mounthoodlodge.com 13.my.to;
    return 404; # managed by Certbot


}

