#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/deployer/.rvm/gems/ruby-2.3.1/gems/passenger-5.0.30; | |
# passenger_ruby /home/deployer/.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; | |
upstream unicorn { | |
server unix:/tmp/unicorn.имя_приложения.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name www.хост.ru; | |
root /home/deployer/имя_приложения/current/public; | |
#passenger_enabled on; | |
client_max_body_size 50M; | |
#charset koi8-r; | |
#access_log logs/host.access.log main; | |
location ^~ /assets { | |
gzip_static on; | |
expires max; | |
add_header Cache-Control public; | |
} | |
try_files $uri/index.html $uri @unicorn; | |
location @unicorn { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://unicorn; | |
} | |
#Далее идут закомментированные дополнительные настройки | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment