Skip to content

Instantly share code, notes, and snippets.

@thanhhh
Created May 20, 2013 06:40
Show Gist options
  • Save thanhhh/5610742 to your computer and use it in GitHub Desktop.
Save thanhhh/5610742 to your computer and use it in GitHub Desktop.
Site configuration on Nginx
# REDMINE
# Maintainer: @thanhhh
# App Version: 2.3.1
upstream redmine {
server unix:/home/redmine/redmine/tmp/sockets/redmine.socket;
}
server {
listen YOUR_SERVER_IP:80 default_server; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea
server_name YOUR_SERVER_FQDN; # e.g., server_name source.example.com;
root /home/redmine/redmine/public;
# individual nginx logs for this gitlab vhost
access_log /var/log/nginx/redmine_access.log;
error_log /var/log/nginx/redmine_error.log;
location / {
# serve static files from defined root folder;.
# @redmine is a named location for the upstream fallback, see below
try_files $uri $uri/index.html $uri.html @redmine;
}
# if a file, which is not found in the root folder is requested,
# then the proxy pass the request to the upsteam (gitlab unicorn)
location @redmine {
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://redmine;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment