-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
1,034 additions
and
8 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
upstream owntrackbackend { | ||
server 127.0.0.1:{{owntracks_port}}; | ||
} | ||
|
||
server { | ||
if ($host = {{owntracks_domain_name}}) { | ||
return 301 https://$host$request_uri; | ||
} | ||
|
||
listen 80; | ||
server_name {{owntracks_domain_name}}; | ||
return 404; | ||
} | ||
|
||
server { | ||
## | ||
# Basic Settings | ||
# | ||
listen 443 ssl; | ||
server_name {{owntracks_domain_name}}; | ||
|
||
root /var/www/html/{{owntracks_domain_name}}; | ||
index index.html; | ||
|
||
charset utf-8; | ||
expires $expires; | ||
add_header Strict-Transport-Security max-age=15768000; | ||
add_header X-Content-Type-Options nosniff; | ||
add_header X-XSS-Protection "1; mode=block"; | ||
|
||
## | ||
# SSL Settings | ||
## | ||
ssl_certificate /etc/letsencrypt/live/{{owntracks_domain_name}}/fullchain.pem; | ||
ssl_certificate_key /etc/letsencrypt/live/{{owntracks_domain_name}}/privkey.pem; | ||
include /etc/letsencrypt/options-ssl-nginx.conf; | ||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; | ||
|
||
## | ||
# Path & Error Settings | ||
## | ||
location / { | ||
auth_basic "Who are you?"; | ||
auth_basic_user_file /etc/nginx/.htpasswd; | ||
proxy_pass http://owntrackbackend; | ||
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_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
error_page 404 /404.html; | ||
location /404.html { | ||
internal; | ||
} | ||
|
||
## | ||
# Logging Settings | ||
## | ||
access_log /var/log/nginx/{{owntracks_domain_name}}_access.log; | ||
error_log /var/log/nginx/{{owntracks_domain_name}}_error.log; | ||
|
||
location /robots.txt { | ||
access_log off; | ||
} | ||
|
||
location ~ /favicon.png { | ||
access_log off; | ||
} | ||
|
||
|
||
## | ||
# Gzip Settings | ||
## | ||
gzip on; | ||
gzip_types text/plain application/json; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[Unit] | ||
Description=Owntracks Recorder server | ||
Requires=network.target | ||
After=network.target | ||
|
||
[Service] | ||
Type=simple | ||
WorkingDirectory=/opt/owntracks-recorder | ||
ExecReload=/bin/kill -HUP $MAINPID | ||
ExecStart=/usr/local/bin/ot-recorder --config /opt/owntracks-recorder/config.yml serve | ||
|
||
Restart=always | ||
RestartSec=3 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
Oops, something went wrong.