From 31cca80fc13c5ed14649f794dafd3d9af052d8e3 Mon Sep 17 00:00:00 2001 From: "Jesse C. Fisher" Date: Fri, 15 Mar 2019 23:34:18 -0700 Subject: [PATCH] Set dev port --- bin/rails | 3 ++ ...abase.example.yml => database.yml.example} | 11 ++-- config/nginx/13dev.quaff.top.conf | 50 +++++++++++++++++++ 3 files changed, 61 insertions(+), 3 deletions(-) rename config/{database.example.yml => database.yml.example} (63%) create mode 100644 config/nginx/13dev.quaff.top.conf diff --git a/bin/rails b/bin/rails index 601ffaf..ddbc1f2 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,7 @@ #!/usr/bin/env ruby +if ENV['RAILS_ENV'] == 'development' + ENV['PORT'] = '9012' +end APP_PATH = File.expand_path('../../config/application', __FILE__) require_relative '../config/boot' require 'rails/commands' diff --git a/config/database.example.yml b/config/database.yml.example similarity index 63% rename from config/database.example.yml rename to config/database.yml.example index 0178f8b..ca29220 100644 --- a/config/database.example.yml +++ b/config/database.yml.example @@ -3,13 +3,18 @@ default: &default encoding: unicode pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> template: template0 - password: + password: 2wsx1qaz + development: <<: *default - database: thirteen_development + database: thirteen_development_example + +test: + <<: *default + database: thirteen_test_example production: <<: *default - database: thirteen_production + database: thirteen_production_example username: <%= ENV['THIRTEEN_DB_USER'] %> password: <%= ENV['THIRTEEN_DB_PASSWORD'] %> diff --git a/config/nginx/13dev.quaff.top.conf b/config/nginx/13dev.quaff.top.conf new file mode 100644 index 0000000..fe50871 --- /dev/null +++ b/config/nginx/13dev.quaff.top.conf @@ -0,0 +1,50 @@ +upstream 13dev { + server localhost:9012; +} + +server { + server_name 13dev.quaff.top; + root /home/jesse/web/thirteen-tien-len/public; + access_log /home/jesse/web/thirteen-tien-len/log/nginx.log; + + try_files $uri @app; + + location @app { + proxy_pass http://13dev; + 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 + +} + + +server { + if ($host = 13dev.quaff.top) { + return 301 https://$host$request_uri; + } # managed by Certbot + + + server_name 13dev.quaff.top; + listen 80; + return 404; # managed by Certbot + + +} \ No newline at end of file