Skip to content

Instantly share code, notes, and snippets.

@Epictetus
Forked from xfyuan/crontab
Created August 13, 2022 02:52

Revisions

  1. @alea12 alea12 created this gist Mar 28, 2017.
    1 change: 1 addition & 0 deletions crontab
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    00 05 01 * * /home/alea12/letsencrypt/letsencrypt-auto certonly --webroot -w /var/www/html -d example.net --renew-by-default && nginx -t && nginx -s reload
    11 changes: 11 additions & 0 deletions puma.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    # config/puma.rb

    # ...

    _proj_path = "#{File.expand_path("../..", __FILE__)}"
    _proj_name = File.basename(_proj_path)
    _home = ENV.fetch("HOME") { "/home/alea12" }

    pidfile "#{_home}/run/#{_proj_name}.pid"
    bind "unix://#{_home}/run/#{_proj_name}.sock"
    directory _proj_path
    39 changes: 39 additions & 0 deletions rails-5-test.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    # /etc/nginx/conf.d/rails-5-test.conf

    upstream rails-5-test {
    server unix:/home/alea12/run/rails-5-test.sock fail_timeout=0;
    }

    server {
    listen 80;
    listen [::]:80;
    server_name example.net;
    return 301 https://$host$request_uri;
    }

    server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    ssl_certificate /etc/letsencrypt/live/example.net/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.net/privkey.pem;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl on;
    ssl_prefer_server_ciphers on;
    ssl_dhparam /etc/nginx/ssl/dhparam.pem;
    add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains;';

    root /home/alea12/rails-5-test/public;
    try_files $uri/index.html $uri @rails-5-test;

    location / {
    proxy_pass http://rails-5-test;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_redirect off;
    }

    error_page 500 502 503 504 /500.html;
    client_max_body_size 4G;
    keepalive_timeout 30;
    }