1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/owntracks_ynh.git synced 2024-09-03 19:56:24 +02:00
owntracks_ynh/conf/nginx.conf
2024-06-03 23:49:41 +02:00

76 lines
3 KiB
Nginx Configuration File

#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ {
alias __INSTALL_DIR__/www/;
index index.html;
more_set_headers "X-Frame-Options: SAMEORIGIN";
more_clear_headers "X-Content-Type-Options";
more_set_headers "X-XSS-Protection: '1; mode=block'";
more_set_headers "Content-Security-Policy: frame-ancestors 'self'";
# Proxy and upgrade WebSocket connection
location __PATH__/recorder/ws {
#rewrite ^__PATH__/recorder/(.*) /$1 break;
proxy_pass http://127.0.0.1:__PORT__/ws/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location __PATH__/recorder/ {
proxy_pass http://127.0.0.1:__PORT__/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
# OwnTracks Recorder Views (requires /view, /static, /utils)
location __PATH__/recorder/view/ {
proxy_buffering off; # Chrome
proxy_pass http://127.0.0.1:__PORT__/view/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location __PATH__/recorder/static/ {
proxy_pass http://127.0.0.1:__PORT__/static/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location __PATH__/recorder/utils/ {
proxy_pass http://127.0.0.1:__PORT__/utils/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
# HTTP Mode
location __PATH__/recorder/pub {
# Basic auth is disabled in favour of YunoHost's SSO
#auth_basic "OwnTracks pub";
#auth_basic_user_file /usr/local/etc/nginx/owntracks.htpasswd;
proxy_pass http://127.0.0.1:__PORT__/pub;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
# Optionally force Recorder to use username from Basic
# authentication user. Whether or not client sets
# X-Limit-U and/or uses ?u= parameter, the user will
# be set to $remote_user.
proxy_set_header X-Limit-U $remote_user;
}
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
}