Created
December 28, 2016 20:51
-
-
Save wzulfikar/ccc5e66670c4389d958303229ff79206 to your computer and use it in GitHub Desktop.
traccar config for nginx: proxy set for web & websocket. tested with cloudflare (https set to flexible). original: https://www.traccar.org/forums/topic/nginx-alias-configuration/
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
server { | |
listen 443; | |
listen 80; | |
server_name tracking.domain.com; | |
add_header Strict-Transport-Security max-age=63072000; | |
#client_max_body_size 200M; | |
# Security features | |
if ($http_user_agent ~* LWP::Simple|BBBike|wget) { | |
return 403; | |
} | |
if ($http_user_agent ~* msnbot|scrapbot) { | |
return 403; | |
} | |
# Traccar Setup | |
location / { | |
proxy_set_header Host $host; | |
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_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_redirect http://0.0.0.0:8082/ /; | |
proxy_redirect ws://0.0.0.0:8082/api/socket /api/socket; | |
proxy_pass http://0.0.0.0:8082/; | |
} | |
} |
Did you manage to figure out why is the reason of the timeout after 60s ? is that being triggered even if packets are being sent ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
server {
listen 80;
server_name server.com;
add_header Strict-Transport-Security max-age=63072000;
#client_max_body_size 200M;
Security features
if ($http_user_agent ~* LWP::Simple|BBBike|wget) {
return 403;
}
if ($http_user_agent ~* msnbot|scrapbot) {
return 403;
}
Traccar Setup
location / {
proxy_set_header Host $host;
}
}
add
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
for error in websocket error in webgui after 60s.