Proxy_pass proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for Server_name localhost # or your server name Server unix:/var/www/my_app/shared/sockets/puma.sock # Path to Puma SOCK file, as defined previously Worker_processes 1 # this may connect with the worker numbers puma can use. Then create a new nf file with your favorite editor, copy codes below and modify as you like: $ mkdir -p shared/pids shared/sockets shared/log Under your app folder, create sockets, pid and log folder with Then add puma gem in the Gemfile and install with Start by copying your app to /var/www/my_app. While reverse proxy server would acts as a load balancer that routes all external requests to a pool of web apps.įor a webserver it is better to use a server user and group, check Users and groups#Example adding a user, below use rails as user name and server as group name, also my_app as rails app name. It was designed to be the go-to server for Rubinius, but also works well with JRuby and MRI. Puma ( Github Page) is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for Ruby/Rack applications, and is considered the replacement for Webrick and Mongrel. Puma (with Nginx as reverse proxy server) Rails_env development # Rails environment. Root path_to_app/public # Be sure to point to 'public' folder! To serve an application with Nginx, configure it as follows: The installer will provide you with any additional information regarding the installation (such as installing additional libraries). In case a rails application is deployed with a sub-URI, like, some additional configuration is required, see the Passenger documentationįor Nginx, install the nginx-mod-passenger package (if passenger is not installed from gem), and run: If you are aiming to use Apache HTTP Server, install the mod_passenger package (if passenger is not installed from gem), and run:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |