Created
March 21, 2014 08:39
-
-
Save pomahtuk/9682076 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
upstream izi-cms3 { | |
server unix:/home/deployer/apps/izi-cms3/shared/sockets/unicorn.sock fail_timeout=0; | |
} | |
server { | |
listen 80 default_server deferred; | |
server_name localhost; | |
root /home/deployer/apps/izi-cms3/current/public; | |
access_log /home/deployer/apps/izi-cms3/shared/logs combined; | |
location ^~ /assets/ { | |
root /home/deployer/apps/izi-cms3/current/public; | |
gzip_static on; # to serve pre-gzipped version | |
expires max; | |
add_header Cache-Control public; | |
} | |
location ^~ /api/ { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-NginX-Proxy true; | |
proxy_pass http://localhost:3000; | |
proxy_redirect off; | |
} | |
} | |
location = /robots.txt { | |
alias /home/deployer/apps/shared/robots.txt; | |
} | |
location ^~ /(404|505|maintenance).html { | |
root /home/deployer/apps/izi-cms3/current/public; | |
} | |
error_page 404 /404.html; | |
error_page 500 503 504 /500.html; | |
error_page 502 /maintenance.html; | |
location / { | |
try_files $uri @unicorn; | |
} | |
#try_files $uri @unicorn; | |
location @unicorn { | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://izi-cms3; | |
} | |
client_max_body_size 4G; | |
keepalive_timeout 10; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment