Compare commits
1 Commits
6b113c1f3e
...
edc0d6a002
| Author | SHA1 | Date | |
|---|---|---|---|
| edc0d6a002 |
64
jetson/nginx/saul-tee.conf
Normal file
64
jetson/nginx/saul-tee.conf
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
# saul-tee.conf — nginx site for saul-t-mote.evthings.app reverse proxy
|
||||||
|
#
|
||||||
|
# Replaces: python3 -m http.server 8080 --directory /home/seb
|
||||||
|
# Router (ASUS Merlin / OpenResty) terminates TLS on :443 and proxies to Orin:8080
|
||||||
|
#
|
||||||
|
# Deploy:
|
||||||
|
# sudo cp saul-tee.conf /etc/nginx/sites-available/saul-tee
|
||||||
|
# sudo ln -sf /etc/nginx/sites-available/saul-tee /etc/nginx/sites-enabled/saul-tee
|
||||||
|
# sudo systemctl reload nginx
|
||||||
|
#
|
||||||
|
# ROUTER REQUIREMENT for WSS to work:
|
||||||
|
# The ASUS Merlin router's nginx/OpenResty must proxy /rosbridge with
|
||||||
|
# WebSocket headers. Add to /jffs/configs/nginx.conf.add:
|
||||||
|
#
|
||||||
|
# map $http_upgrade $connection_upgrade {
|
||||||
|
# default upgrade;
|
||||||
|
# '' close;
|
||||||
|
# }
|
||||||
|
#
|
||||||
|
# And in the server block that proxies to 192.168.86.158:8080, add:
|
||||||
|
#
|
||||||
|
# location /rosbridge {
|
||||||
|
# proxy_pass http://192.168.86.158:8080/rosbridge;
|
||||||
|
# proxy_http_version 1.1;
|
||||||
|
# proxy_set_header Upgrade $http_upgrade;
|
||||||
|
# proxy_set_header Connection $connection_upgrade;
|
||||||
|
# proxy_read_timeout 86400;
|
||||||
|
# }
|
||||||
|
|
||||||
|
# Infer WebSocket upgrade from Connection header.
|
||||||
|
# Handles the case where an upstream proxy (e.g. ASUS Merlin OpenResty)
|
||||||
|
# passes Connection: upgrade but strips the Upgrade: websocket header.
|
||||||
|
map $http_connection $ws_upgrade {
|
||||||
|
"upgrade" "websocket";
|
||||||
|
default "";
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 8080 default_server;
|
||||||
|
listen [::]:8080 default_server;
|
||||||
|
|
||||||
|
root /home/seb;
|
||||||
|
index index.html;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
# Static files — replaces python3 -m http.server 8080 --directory /home/seb
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
autoindex on;
|
||||||
|
}
|
||||||
|
|
||||||
|
# rosbridge WebSocket reverse proxy
|
||||||
|
# wss://saul-t-mote.evthings.app/rosbridge --> ws://127.0.0.1:9090
|
||||||
|
location /rosbridge {
|
||||||
|
proxy_pass http://127.0.0.1:9090/;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $ws_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_read_timeout 86400;
|
||||||
|
proxy_send_timeout 86400;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user