Skip to content

Instantly share code, notes, and snippets.

@spikeheap
Created November 20, 2013 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spikeheap/7565496 to your computer and use it in GitHub Desktop.
Save spikeheap/7565496 to your computer and use it in GitHub Desktop.
Sample configuration file for nginx to serve a homebrew installation of Sonar
upstream sonar {
server 127.0.0.1:9000 fail_timeout=0;
}
server {
access_log /opt/boxen/log/nginx/sonar.access.log;
error_log /opt/boxen/log/nginx/sonar.error.log;
listen 80;
server_name sonar.dev;
client_max_body_size 50M;
error_page 500 502 503 504 /50x.html;
if ($host ~* "www") {
rewrite ^(.*)$ http://sonar.dev$1 permanent;
break;
}
location / {
proxy_buffering off;
proxy_max_temp_file_size 0;
proxy_redirect off;
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_pass http://sonar;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment