Created
December 26, 2016 17:04
-
-
Save mgrigoriev/7ac8052341a10410437082b8db1bfb19 to your computer and use it in GitHub Desktop.
This file contains 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
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
# passenger_root /home/deployer/.rvm/gems/ruby-2.3.3/gems/passenger-5.1.0; | |
# passenger_ruby /home/deployer/.rvm/gems/ruby-2.3.3/wrappers/ruby; | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
keepalive_timeout 65; | |
gzip on; | |
upstream unicorn { | |
server unix:/tmp/unicorn.askandhack.sock fail_timeout=0; | |
} | |
upstream websocket { | |
server 127.0.0.1:28080; | |
} | |
server { | |
listen 80; | |
server_name 95.213.195.145; | |
root /home/deployer/askandhack/current/public; | |
# passenger_enabled on; | |
client_max_body_size 20M; | |
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; | |
} | |
location /cable { | |
proxy_pass http://unicorn/cable; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade websocket; | |
proxy_set_header Connection Upgrade; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment