-
-
Save regedarek/de7f2e5cd1918b6224ac 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 backend { | |
server unix:/tmp/.sock; | |
} | |
server { | |
listen 80 default; | |
location / { | |
proxy_pass http://backend; | |
} | |
root /var/www/ck.uci.agh.edu.pl/public; | |
charset utf-8; | |
server_name _; # all accept | |
location ~* ^/assets { | |
expires max; | |
add_header Cache-Control public; | |
break; | |
} | |
error_page 404 /404.html; | |
} |
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
user www-data; | |
worker_processes 1; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 768; | |
accept_mutex off; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
## | |
# Basic Settings | |
## | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay off; | |
keepalive_timeout 65; | |
types_hash_max_size 2048; | |
## | |
# Logging Settings | |
## | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
## | |
# Gzip Settings | |
## | |
gzip on; | |
gzip_http_version 1.0; | |
gzip_proxied any; | |
gzip_min_length 500; | |
gzip_disable "MSIE [1-6]\."; | |
gzip_types text/plain text/html text/xml text/css | |
text/comma-separated-values | |
text/javascript application/x-javascript | |
application/atom+xml; | |
## | |
# Virtual Host Configs | |
## | |
include /etc/nginx/conf.d/*.conf; | |
include /etc/nginx/sites-enabled/*; | |
} |
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 | |
APP_PATH = "/var/www/ck.uci.agh.edu.pl" | |
working_directory APP_PATH | |
stderr_path APP_PATH + "/log/unicorn.stderr.log" | |
stdout_path APP_PATH + "/log/unicorn.stderr.log" | |
pid APP_PATH + "/tmp/unicorn.pid" | |
listen "/tmp/.sock", :backlog => 64 | |
listen 8080, :tcp_nopush => true | |
timeout 30 | |
preload_app true | |
GC.respond_to?(:copy_on_write_friendly=) and | |
GC.copy_on_write_friendly = true | |
check_client_connection false | |
before_fork do |server, worker| | |
defined?(ActiveRecord::Base) and | |
ActiveRecord::Base.connection.disconnect! | |
end | |
after_fork do |server, worker| | |
defined?(ActiveRecord::Base) and | |
ActiveRecord::Base.establish_connection | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment