PageSourceSearch

https://pixelpoint.io/component---src-templates-blog-post-jsx-cont…x-and-puma-index-md-596c14c48131ca8f392f.js

js pixelpoint.io collected 2026-10-03 22:11:56 UTC 28,184 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkpixelpoint_website=self.webpackChunkpixelpoint_website||[]).push([[7241],{5825:function(e,o,t){t.r(o),t.d(o,{Head:function(){return x},default:function(){return f}});var n=t(8453),r=t(6540),s=t(4754);const i={annotations:s.hk,Code:s.Cy},a={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:void 0,showCopyButton:!0,themeName:"dark-plus"};function l(e){const o=Object.assign({h2:"h2",a:"a",span:"span",p:"p",ul:"ul",li:"li"},(0,n.RP)(),e.components);return i||p("CH",!1),i.Code||p("CH.Code",!0),r.createElement(r.Fragment,null,r.createElement("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="dark-plus"] {  --ch-t-colorScheme: var(--ch-0);--ch-t-foreground: var(--shiki-token-embed);--ch-t-background: var(--shiki-background-editor);--ch-t-editor-background: var(--shiki-background-editor);--ch-t-editor-foreground: var(--shiki-token-embed);--ch-t-tab-activeBackground: var(--shiki-background-editor);--ch-t-tab-inactiveBackground: var(--shiki-background-editor);--ch-t-tab-border: var(--shiki-menu-background);--ch-t-tab-activeBorder: var(--shiki-background-editor);--ch-t-editorGroupHeader-tabsBackground: var(--shiki-background-header);--ch-t-input-foreground: var(--shiki-token-embed);--ch-t-sideBar-foreground: var(--shiki-token-embed); }'}}),"\n",r.createElement(o.h2,{id:"what-is-mina"},r.createElement(o.a,{"aria-hidden":"true",tabIndex:"-1",href:"#what-is-mina"},r.createElement(o.span,{className:"icon icon-link"})),"What is Mina?"),"\n",r.createElement(o.p,null,"Mina is a deployment tool, similar to Capistrano. The major advantage of Mina is its speed. Mina works exceptionally fast because it’s a deploy Bash script generator. It generates an entire procedure as a Bash script, and runs it remotely in the server. It also supports smart command execution, so if you do not change assets (CSS, JS, images), it will not execute assets precompile. The same goes for migrations."),"\n",r.createElement(o.ul,null,"\n",r.createElement(o.li,null,r.createElement(o.a,{href:"https://github.com/mina-deploy/mina"},"Github")),"\n",r.createElement(o.li,null,r.createElement(o.a,{href:"https://infinum.co/the-capsized-eight/faster-web-application-deployments-using-mina-instead-of-capistrano"},"Mina vs. Capistrano")),"\n"),"\n",r.createElement(o.h2,{id:"mina-setup"},r.createElement(o.a,{"aria-hidden":"true",tabIndex:"-1",href:"#mina-setup"},r.createElement(o.span,{className:"icon icon-link"})),"Mina Setup"),"\n",r.createElement(o.p,null,"Let’s take a look at setting up Mina with Puma. First, you’ll need to add Mina and mina-puma in Gemfile, which is located in the development section. Mina recently changed its maintainer; a new repository is here, and it is best to install it from Git."),"\n",r.createElement(i.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"gem ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'mina'",props:{style:{color:"var(--shiki-token-string)"}}},{content:", require: ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"false",props:{style:{color:"var(--shiki-token-operator)"}}}]},{tokens:[{content:"gem ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'mina-puma'",props:{style:{color:"var(--shiki-token-string)"}}},{content:", require: ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"false",props:{style:{color:"var(--shiki-token-operator)"}}},{content:",  github: ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'untitledkingdom/mina-puma'",props:{style:{color:"var(--shiki-token-string)"}}}]}],lang:"ruby"},annotations:[]}]}),"\n",r.createElement(o.p,null,"Add Puma gem to the global section if you are using a Rails version below 5."),"\n",r.createElement(o.p,null,"Then, install gems and execute the initial Mina command for generating a config/deploy.rb file."),"\n",r.createElement(i.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"bundle",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"mina ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"init",props:{style:{color:"var(--shiki-token-string)"}}}]}],lang:"bash"},annotations:[]}]}),"\n",r.createElement(o.p,null,"You can find an example of a Mina 1.0.0 default config here. Click here for the full config in that configuration."),"\n",r.createElement(o.h2,{id:"detailed-explanations-of-the-mina-deploy-file"},r.createElement(o.a,{"aria-hidden":"true",tabIndex:"-1",href:"#detailed-explanations-of-the-mina-deploy-file"},r.createElement(o.span,{className:"icon icon-link"})),"Detailed explanations of the Mina deploy file"),"\n",r.createElement(i.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"#Set the domain or ip address of the remote server.",props:{style:{color:"var(--shiki-token-comment)"}}}]},{tokens:[{content:"set :domain, ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'yourdomain.ru'",props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"#Set the folder of the remote server where Mina will deploy your application.",props:{style:{color:"var(--shiki-token-comment)"}}}]},{tokens:[{content:"set :deploy_to, ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'path/to/directory'",props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"#Set a link to the repository. Example: [email protected]/myapp.git",props:{style:{color:"var(--shiki-token-comment)"}}}]},{tokens:[{content:"set :repository, ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'git@…'",props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"#Set the name of a branch you plan to deploy as default master.",props:{style:{color:"var(--shiki-token-comment)"}}}]},{tokens:[{content:"set :branch, ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'master'",props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"#Fill in the names of the files and directories that will be symlinks to the shared directory.",props:{style:{color:"var(--shiki-token-comment)"}}}]},{tokens:[{content:"#All folders will be created automatically on Mina setup.",props:{style:{color:"var(--shiki-token-comment)"}}}]},{tokens:[{content:"#Don’t forget to add a path to the uploads folder if you are using Dragonfly or CarrierWave.",props:{style:{color:"var(--shiki-token-comment)"}}}]},{tokens:[{content:"#Otherwise, you will lose your uploads on each deploy.",props:{style:{color:"var(--shiki-token-comment)"}}}]},{tokens:[{content:"set :shared_dirs, fetch(:shared_dirs, []).push(",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'log'",props:{style:{color:"var(--shiki-token-string)"}}},{content:", ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'tmp/pids'",props:{style:{color:"var(--shiki-token-string)"}}},{content:", ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'tmp/sockets'",props:{style:{color:"var(--shiki-token-string)"}}},{content:", ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'public/uploads'",props:{style:{color:"var(--shiki-token-string)"}}},{content:")",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"set :shared_files, fetch(:shared_files, []).push(",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'config/database.yml'",props:{style:{color:"var(--shiki-token-string)"}}},{content:", ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'config/secrets.yml'",props:{style:{color:"var(--shiki-token-string)"}}},{content:", ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'config/puma.rb'",props:{style:{color:"var(--shiki-token-string)"}}},{content:")",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"#Username of ssh user for access to the remote server.",props:{style:{color:"var(--shiki-token-comment)"}}}]},{tokens:[{content:"set :user, ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'username'",props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"#This is not a required field. You can use it to set an application name for easy recognition.",props:{style:{color:"var(--shiki-token-comment)"}}}]},{tokens:[{content:"set :application_name, ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'MyApplication'",props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"#Set ruby version. If you have RVM installed globally, you’ll also need to set an RVM path,",props:{style:{color:"var(--shiki-token-comment)"}}}]},{tokens:[{content:"#like: set :rvm_use_path, '/usr/local/rvm/scripts/rvm'.",props:{style:{color:"var(--shiki-token-comment)"}}}]},{tokens:[{content:"#You can find the RVM location with the rvm info command.",props:{style:{color:"var(--shiki-token-comment)"}}}]},{tokens:[{content:"task :environment ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"do",props:{style:{color:"var(--shiki-token-keyword)"}}}]},{tokens:[{content:"  invoke :'rvm:use', ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'ruby-2.4.0@default'",props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"end",props:{style:{color:"var(--shiki-token-keyword)"}}}]}],lang:"ruby"},annotations:[]}]}),"\n",r.createElement(o.p,null,"By default, Mina will create all folders mentioned in shared_dirs and shared_files. In setup, however, you can add section auto-creation of empty files and fill them later."),"\n",r.createElement(i.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"task :setup ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"do",props:{style:{color:"var(--shiki-token-keyword)"}}}]},{tokens:[{content:"  command ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:'%[touch "',props:{style:{color:"var(--shiki-token-string)"}}},{content:"#{",props:{style:{color:"var(--shiki-color-text)"}}},{content:"fetch(:shared_path)",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"}",props:{style:{color:"var(--shiki-color-text)"}}},{content:'/config/database.yml"]',props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"  command ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:'%[touch "',props:{style:{color:"var(--shiki-token-string)"}}},{content:"#{",props:{style:{color:"var(--shiki-color-text)"}}},{content:"fetch(:shared_path)",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"}",props:{style:{color:"var(--shiki-color-text)"}}},{content:'/config/secrets.yml"]',props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"  command ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:'%[touch "',props:{style:{color:"var(--shiki-token-string)"}}},{content:"#{",props:{style:{color:"var(--shiki-color-text)"}}},{content:"fetch(:shared_path)",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"}",props:{style:{color:"var(--shiki-color-text)"}}},{content:'/config/puma.rb"]',props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"  comment ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"\"Be sure to edit '",props:{style:{color:"var(--shiki-token-string)"}}},{content:"#{",props:{style:{color:"var(--shiki-color-text)"}}},{content:"fetch(:shared_path)",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"}",props:{style:{color:"var(--shiki-color-text)"}}},{content:"/config/database.yml', 'secrets.yml' and puma.rb.\"",props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"end",props:{style:{color:"var(--shiki-token-keyword)"}}}]}],lang:"ruby"},annotations:[]}]}),"\n",r.createElement(o.p,null,"After these actions, you are ready to run Mina setup to prepare all necessary file structures at the remote server."),"\n",r.createElement(o.p,null,"Your deploy section in deploy.rb should look like this:"),"\n",r.createElement(i.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"task :
1deploy ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"do",props:{style:{color:"var(--shiki-token-keyword)"}}}]},{tokens:[{content:"  deploy ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"do",props:{style:{color:"var(--shiki-token-keyword)"}}}]},{tokens:[{content:"    comment ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:'"Deploying ',props:{style:{color:"var(--shiki-token-string)"}}},{content:"#{",props:{style:{color:"var(--shiki-color-text)"}}},{content:"fetch(:application_name)",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"}",props:{style:{color:"var(--shiki-color-text)"}}},{content:" to ",props:{style:{color:"var(--shiki-token-string)"}}},{content:"#{",props:{style:{color:"var(--shiki-color-text)"}}},{content:"fetch(:domain)",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"}",props:{style:{color:"var(--shiki-color-text)"}}},{content:":",props:{style:{color:"var(--shiki-token-string)"}}},{content:"#{",props:{style:{color:"var(--shiki-color-text)"}}},{content:"fetch(:deploy_to)",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"}",props:{style:{color:"var(--shiki-color-text)"}}},{content:'"',props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"    invoke :'git:clone'",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"    invoke :'deploy:link_shared_paths'",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"    invoke :'rvm:load_env_vars'",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"    invoke :'bundle:install'",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"    invoke :'rails:db_migrate'",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"    command ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"%{",props:{style:{color:"var(--shiki-token-string)"}}},{content:"#{",props:{style:{color:"var(--shiki-color-text)"}}},{content:"fetch(:rails)",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"}",props:{style:{color:"var(--shiki-color-text)"}}},{content:" db:seed}",props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"    invoke :'rails:assets_precompile'",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"    invoke :'deploy:cleanup'",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"    on :launch ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"do",props:{style:{color:"var(--shiki-token-keyword)"}}}]},{tokens:[{content:"      invoke :'puma:phased_restart'",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"    end",props:{style:{color:"var(--shiki-token-keyword)"}}}]},{tokens:[{content:"  end",props:{style:{color:"var(--shiki-token-keyword)"}}}]},{tokens:[{content:"end",props:{style:{color:"var(--shiki-token-keyword)"}}}]}],lang:"ruby"},annotations:[]}]}),"\n",r.createElement(o.h2,{id:"puma-setup"},r.createElement(o.a,{"aria-hidden":"true",tabIndex:"-1",href:"#puma-setup"},r.createElement(o.span,{className:"icon icon-link"})),"Puma Setup"),"\n",r.createElement(o.p,null,"Create or fill a puma.rb file in a config folder."),"\n",r.createElement(i.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"environment ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:'"production"',props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"bind  ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:'"unix:///{path_to_your_app}/shared/tmp/sockets/puma.sock"',props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"pidfile ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:'"/{path_to_your_app}/shared/tmp/pids/puma.pid"',props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"state_path ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:'"/{path_to_your_app}/shared/tmp/sockets/puma.state"',props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"directory ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:'"/{path_to_your_app}/current"',props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"workers ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"2",props:{style:{color:"var(--shiki-token-constant)"}}}]},{tokens:[{content:"threads ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"1",props:{style:{color:"var(--shiki-token-constant)"}}},{content:",",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"2",props:{style:{color:"var(--shiki-token-constant)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"daemonize ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"true",props:{style:{color:"var(--shiki-token-operator)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"activate_control_app ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"'unix:///{path_to_your_app}/shared/tmp/sockets/pumactl.sock'",props:{style:{color:"var(--shiki-token-string)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"prune_bundler",props:{style:{color:"var(--shiki-token-embed)"}}}]}],lang:"ruby"},annotations:[]}]}),"\n",r.createElement(o.p,null,"You must point a path to pumactl.sock at activate_control_app. Otherwise, Mina puma:stop and restart will not work."),"\n",r.createElement(o.h2,{id:"fill-databaseyml-and-secretsyml"},r.createElement(o.a,{"aria-hidden":"true",tabIndex:"-1",href:"#fill-databaseyml-and-secretsyml"},r.createElement(o.span,{className:"icon icon-link"})),"Fill database.yml and secrets.yml"),"\n",r.createElement(o.p,null,"Go to the shared folder and make sure that you fill these two files."),"\n",r.createElement(o.h2,{id:"setup-nginx"},r.createElement(o.a,{"aria-hidden":"true",tabIndex:"-1",href:"#setup-nginx"},r.createElement(o.span,{className:"icon icon-link"})),"Setup nginx"),"\n",r.createElement(o.p,null,"Create file myapp.conf in a /nginx/etc/conf.d folder with similar content."),"\n",r.createElement(i.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"upstream",props:{style:{color:"var(--shiki-token-keyword)"}}},{content:" mysite {",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"  server",props:{style:{color:"var(--shiki-token-operator)"}}},{content:" unix:///home/admin/mysite/shared/tmp/sockets/puma.sock ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"fail_timeout",props:{style:{color:"var(--shiki-color-text)"}}},{content:"=",props:{style:{color:"var(--shiki-token-keyword)"}}},{content:"0",props:{style:{color:"var(--shiki-token-constant)"}}},{content:";",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"}",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"server {",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"  listen ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"80",props:{style:{color:"var(--shiki-token-constant)"}}},{content:";",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"  listen ",props:{style:{color:"var(--shiki-token-operator)"}}},{content:"[::]:80;",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"  server_name ",props:{style:{color:"var(--shiki-token-operator)"}}},{content:"mysite.com;",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"  root ",props:{style:{color:"var(--shiki-token-operator)"}}},{content:"/home/admin/mysite/current/public;",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"  location ~ ",props:{style:{color:"var(--shiki-token-keyword)"}}},{content:"^/assets/ ",props:{style:{color:"var(--shiki-token-regex)"}}},{content:"{",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"    expires ",props:{style:{color:"var(--shiki-token-operator)"}}},{content:"max;",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"    gzip_static ",props:{style:{color:"var(--shiki-token-operator)"}}},{content:"on;",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"    gzip_vary ",props:{style:{color:"var(--shiki-token-operator)"}}},{content:"on;",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"    add_header ",props:{style:{color:"var(--shiki-token-operator)"}}},{content:"Cache-Control public;",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"    break",props:{style:{color:"var(--shiki-token-operator)"}}},{content:";",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"  }",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"  location",props:{style:{color:"var(--shiki-token-keyword)"}}},{content:" / {",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"    proxy_pass ",props:{style:{color:"var(--shiki-token-operator)"}}},{content:"http://mysite;",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"    proxy_set_header ",props:{style:{color:"var(--shiki-token-operator)"}}},{content:"Host $",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"host",props:{style:{color:"var(--shiki-color-text)"}}},{content:";",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"    proxy_set_header ",props:{style:{color:"var(--shiki-token-operator)"}}},{content:"X-Forwarded-For $",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"proxy_add_x_forwarded_for",props:{style:{color:"var(--shiki-color-text)"}}},{content:";",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"  }",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"  location ~ ",props:{style:{color:"var(--shiki-token-keyword)"}}},{content:"^/(500|404|422).html ",props:{style:{color:"var(--shiki-token-regex)"}}},{content:"{",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"    root ",props:{style:{color:"var(--shiki-token-operator)"}}},{content:"/home/admin/mysite/current/public;",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"  }",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"  error_page ",props:{style:{color:"var(--shiki-token-operator)"}}},{content:"500 ",props:{style:{color:"var(--shiki-token-embed)"}}},{content:"502 503 504",props:{style:{color:"var(--shiki-token-constant)"}}},{content:" /500.html;",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"  error_page ",props:{style:{color:"var(--shiki-token-operator)"}}},{content:"404 /404.html;",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"  error_page ",props:{style:{color:"var(--shiki-token-operator)"}}},{content:"422 /422.html;",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"  client_max_body_size ",props:{style:{color:"var(--shiki-token-operator)"}}},{content:"4G;",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"  keepalive_timeout ",props:{style:{color:"var(--shiki-token-operator)"}}},{content:"10;",props:{style:{color:"var(--shiki-token-embed)"}}}]},{tokens:[{content:"}",props:{style:{color:"var(--shiki-token-embed)"}}}]}],lang:"nginx"},annotations:[]}]}),"\n",r.createElement(o.h2,{id:"generate-ssh-keys"},r.createElement(o.a,{"aria-hidden":"true",tabIndex:"-1",href:"#generate-ssh-keys"},r.createElement(o.span,{className:"icon icon-link"})),"Generate ssh keys"),"\n",r.createElement(o.p,null,"Generate new ssh keys on your server by using that command ssh-keygen. Then, export it to the deploys keys of your github/bitbucket project."),"\n",r.createElement(o.h2,{id:"mission-completed"},r.createElement(o.a,{"aria-hidden":"true",tabIndex:"-1",href:"#mission-completed"},r.createElement(o.span,{className:"icon icon-link"})),"Mission Completed"),"\n",r.createElement(o.p,null,"That’s it. Now you’re ready to deploy your application. Run mina deploy if you have already executed mina setup and wait."),"\n",r.createElement(o.h2,{id:"troubleshooting"},r.createElement(o.a,{"aria-hidden":"true",tabIndex:"-1",href:"#troubleshooting"},r.createElement(o.span,{className:"icon icon-link"})),"Troubleshooting"),"\n",r.createElement(o.p,null,"If you have problems on git clone, check that you have exported ssh pub key to your repository, and try to clone the repository directly from the server."),"\n",r.createElement(o.p,null,"Use Mina puma:start on first launch instead of phased_restart."),"\n",r.createElement(o.h2,{id:"useful-links"},r.createElement(o.a,{"aria-hidden":"true",tabIndex:"-1",href:"#useful-links"},r.createElement(o.span,{className:"icon icon-link"})),"Useful Links"),"\n",r.createElement(o.p,null,r.createElement(o.a,{href:"https://github.com/mina-deploy/mina/blob/2608e50049cf21b1425c8bb7c3e5dd0e964b725f/docs/cookbook.md"},"Mina and multi-stages")))}var c=function(e){void 0===e&&(e={});const{wrapper:o}=Object.assign({},(0,n.RP)(),e.components);return o?r.createElement(o,e,r.createElement(l,e)):l(e)};function p(e,o){throw new Error("Expected "+(o?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}var k=t(2532),h=t(1021),d=t(545),m=t(9072),y=t(3669),v=t(9063),u=t
1(352),b=t(84);const g=e=>{let{data:{mdx:{author:o,frontmatter:t,fields:{slug:n}},allMdx:{nodes:s}},location:i,pageContext:{videoCovers:a},children:l}=e;return r.createElement(v.A,{headerTheme:"black",headerShowThemeButton:!0},r.createElement("article",{className:"safe-paddings pt-32 sm:pt-24"},r.createElement("div",{className:"container"},r.createElement("div",{className:"relative mx-auto max-w-[696px] xl:mx-0 xl:flex xl:max-w-none xl:justify-center xl:space-x-20 lg:space-x-8 md:block md:space-x-0"},r.createElement("div",{className:"xl:max-w-[696px] lg:max-w-[626px] md:max-w-none"},r.createElement(d.A,Object.assign({},t,{slug:n})),r.createElement(h.A,{content:l,videoCovers:a})),r.createElement(m.A,{author:o,readMorePosts:s,socialShareUrl:i.href})))),r.createElement(y.A,{withTopMargin:!0}))};function f(e){return r.createElement(g,e,r.createElement(c,e))}const x=e=>{let{data:{mdx:{frontmatter:{title:o,summary:t,ogImage:n}}}}=e;const s=(0,k.d)(n);return r.createElement(u.A,b.A.blogPost({title:o,description:t,ogImage:s}))}}}]);
2//# sourceMappingURL=component---src-templates-blog-post-jsx-content-file-path-content-posts-2017-01-18-deploy-rails-application-with-mina-nginx-and-puma-index-md-596c14c48131ca8f392f.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.