mirror of
https://github.com/owntracks/frontend.git
synced 2026-05-05 03:06:32 +00:00
On my configuration, having a trailing slash on `proxy_pass` but not on the location block causes the sub-path after the `location` to be appended to the `proxy_pass` url, causing a double-forward-slash. E.g. going to `/api/0/list` actually ends up making a call to the proxy of `http://otrecorder/api//0/list`, which fails for me.
37 lines
951 B
Cheetah
37 lines
951 B
Cheetah
worker_processes 1;
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
http {
|
|
upstream otrecorder {
|
|
server ${SERVER_HOST}:${SERVER_PORT};
|
|
}
|
|
server {
|
|
listen ${LISTEN_PORT};
|
|
listen [::]:${LISTEN_PORT};
|
|
root /usr/share/nginx/html;
|
|
location /api/ {
|
|
proxy_pass http://otrecorder/api/;
|
|
}
|
|
location /ws/ {
|
|
proxy_pass http://otrecorder/ws/;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection upgrade;
|
|
}
|
|
location / {
|
|
include /etc/nginx/mime.types;
|
|
try_files $uri $uri/index.html;
|
|
}
|
|
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_proxied any;
|
|
gzip_comp_level 6;
|
|
gzip_buffers 16 8k;
|
|
gzip_http_version 1.1;
|
|
gzip_types text/plain text/css application/json application/javascript text/javascript;
|
|
}
|
|
}
|
|
|