Created
June 5, 2016 13:21
-
-
Save cupnoodle/6a48e77e6243fc2c4c05f9e34b2d58a4 to your computer and use it in GitHub Desktop.
Nginx configuration file to serve Rails app using Passenger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #user nobody; | |
| worker_processes 1; | |
| #error_log logs/error.log; | |
| #error_log logs/error.log notice; | |
| #error_log logs/error.log info; | |
| #pid logs/nginx.pid; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| passenger_root /home/demo/.rvm/gems/ruby-2.3.1/gems/passenger-5.0.28; | |
| passenger_ruby /home/demo/.rvm/gems/ruby-2.3.1/wrappers/ruby; | |
| include mime.types; | |
| default_type application/octet-stream; | |
| #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | |
| # '$status $body_bytes_sent "$http_referer" ' | |
| # '"$http_user_agent" "$http_x_forwarded_for"'; | |
| #access_log logs/access.log main; | |
| sendfile on; | |
| #tcp_nopush on; | |
| #keepalive_timeout 0; | |
| keepalive_timeout 65; | |
| #gzip on; | |
| server { | |
| listen 80; | |
| server_name localhost; | |
| root /path/to/rails_app_root/public; # <-- be sure to point to 'public' | |
| passenger_app_root /path/to/rails_app_root; | |
| passenger_enabled on; | |
| rack_env production; | |
| passenger_env_var SECRET_KEY_BASE d6532f57f0e1f5150f38ef413fd85c2c9081195431177950d6e44248822ab3d05bb2619871c29a8367d95ff04abaaba84bfc4433f37d089c9437c3e2e1efadc6; | |
| passenger_env_var AWESOMEAPP_DATABASE_USERNAME demo; | |
| passenger_env_var AWESOMEAPP_DATABASE_PASSWORD correcthorsebatterystaple; | |
| #access_log logs/host.access.log main; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment