Last active
August 29, 2015 14:17
-
-
Save hainp2604/412f96e36d0943a7058c to your computer and use it in GitHub Desktop.
Server config
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
# Nginx config | |
passenger_root /home/deployer/.rvm/gems/ruby-2.1.3/gems/passenger-4.0.53; | |
#passenger_ruby /usr/bin/ruby; | |
passenger_max_pool_size 70; | |
passenger_min_instances 1; | |
passenger_max_requests 20; # A workaround if apps are mem-leaking | |
passenger_pool_idle_time 300; | |
passenger_max_instances_per_app 30; | |
passenger_pre_start http://service.memo.edu.vn/; | |
## Note: có 2 app cùng cấu hình thế này; | |
server { | |
listen 80; | |
server_name services.memo.edu.vn; | |
passenger_enabled on; | |
root /home/deployer/memo_rails-production/current/public; | |
more_set_headers 'Access-Control-Allow-Origin: *' | |
more_set_headers 'Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE, HEAD'; | |
more_set_headers 'Access-Control-Allow-Headers: DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; | |
if ($request_method = 'OPTIONS') { | |
# more_set_headers 'Access-Control-Allow-Origin: *'; | |
# add_header 'Access-Control-Allow-Origin' '*'; | |
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; | |
# add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-FooA$ | |
# add_header 'Access-Control-Max-Age' 1728000; | |
# add_header 'Content-Type' 'text/plain charset=UTF-8'; | |
# add_header 'Content-Length' 0; | |
return 200; | |
} | |
access_log /var/log/nginx/memo-rails-production.access.log; | |
error_log /var/log/nginx/memo-rails-production.error.log; | |
error_page 404 /404.html; | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root /etc/nginx/html/; | |
} | |
rails_env production; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment