travis-api/config/nginx.conf.erb
Josh Kalderimis efb9d899b2 Signal Sciences support (#254)
* test out setting up signal sciences

* tweak the signalsciences config a little

* try out the updated signal sciences heroku integration

* use the old ngnix start script, as signalsciences is now nginx based

* make sure sigsci conf is included in our custom nginx config

* remove the custom port stuff, no longer needed
2016-05-26 17:44:12 +02:00

50 lines
1.1 KiB
Plaintext

daemon off;
#Heroku dynos have at least 4 cores.
worker_processes <%= ENV['NGINX_WORKERS'] || ENV['WEB_CONCURRENCY'] || 4 %>;
events {
<% if `uname` != "Darwin\n" %>use epoll;<% end %>
accept_mutex on;
worker_connections 1024;
}
http {
gzip on;
gzip_comp_level 2;
gzip_min_length 512;
<% unless ENV['SIGSCI_ENABLED'].nil? || ENV['SIGSCI_ENABLED'].empty? %>
include "../sigsci-module-nginx/sigsci.conf";
<% end %>
server_tokens off;
log_format l2met 'measure#nginx.service=$request_time request_id=$http_x_request_id';
access_log logs/nginx/access.log l2met;
error_log logs/nginx/error.log;
include mime.types;
default_type application/octet-stream;
sendfile on;
#Must read the body in 5 seconds.
client_body_timeout 5;
upstream app_server {
server unix:<%= ENV["tmp_dir"] %>/nginx.socket fail_timeout=0;
}
server {
listen <%= ENV["PORT"] %>;
server_name _;
keepalive_timeout 5;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app_server;
}
}
}