Skip to content

Instantly share code, notes, and snippets.

@Raidok
Last active December 13, 2015 21:37
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 Raidok/b244b6a61d918ea1d931 to your computer and use it in GitHub Desktop.
Save Raidok/b244b6a61d918ea1d931 to your computer and use it in GitHub Desktop.
nginx proxy
<!DOCTYPE html>
<html>
<head>
<title>OSMC</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<style>
html, body {
height: 100%;
}
.vertical-center {
min-height: 100%; /* Fallback for vh unit */
min-height: 100vh; /* You might also want to use
'height' property instead.
Note that for percentage values of
'height' or 'min-height' properties,
the 'height' of the parent element
should be specified explicitly.
In this case the parent of '.vertical-center'
is the <body> element */
/* Make it a flex container */
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
/* Align the bootstrap's container vertically */
-webkit-box-align : center;
-webkit-align-items : center;
-moz-box-align : center;
-ms-flex-align : center;
align-items : center;
/* In legacy web browsers such as Firefox 9
we need to specify the width of the flex container */
width: 100%;
/* Also 'margin: 0 auto' doesn't have any effect on flex items in such web browsers
hence the bootstrap's container won't be aligned to the center anymore.
Therefore, we should use the following declarations to get it centered again */
-webkit-box-pack : center;
-moz-box-pack : center;
-ms-flex-pack : center;
-webkit-justify-content : center;
justify-content : center;
}
</style>
</head>
<body>
<div class="vertical-center">
<div class="well center-block" style="max-width:400px">
<a href="/kodi" class="btn btn-primary btn-lg btn-block">Kodi</a>
<a href="/couchpotato" class="btn btn-primary btn-lg btn-block">Couch Potato</a>
<a href="/sickbeard" class="btn btn-primary btn-lg btn-block">Sick Beard</a>
<a href="/headphones" class="btn btn-primary btn-lg btn-block">Headphones</a>
<a href="/transmission" class="btn btn-primary btn-lg btn-block">Transmission</a>
</div>
</div>
</body>
</html>
server {
listen 80;
listen [::]:80;
access_log off;
rewrite_log on;
location /couchpotato {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8081;
}
location /sickbeard {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8082;
}
location /headphones {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8083;
}
location /kodi {
rewrite ^/kodi$ http://$host/kodi/ permanent;
rewrite ^/kodi/(.*)$ /$1 break;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8000/;
proxy_redirect off;
}
location /kodi/image/ {
rewrite ^/kodi/image/image:/%2f(.*)$ /image/image://$1 break;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8000;
proxy_redirect off;
}
#transmission configuration
location /transmission/ {
proxy_pass_header X-Transmission-Session-Id;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:9091/transmission/web/;
}
# Also Transmission specific
location /rpc {
proxy_pass http://127.0.0.1:9091/transmission/rpc;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment