webssh
webssh copied to clipboard
404 when running behind nginx
https://github.com/huashengdun/webssh/issues/215 was closed with no solution, what is the cause of this? I have the exact issue.
@randomairborne You might post the nginx config...
I faced the same issue while I was trying to use a subdirectory to forward the traffic. For me it was the missing "/" in the defined location:
- non working:
location /console {
proxy_pass http://127.0.0.1:8888
}
- working:
location /console/ {
proxy_pass http://127.0.0.1:8888
}
my nginx localtion
location /pptssh/ {
proxy_pass http://127.0.0.1:8888;
proxy_http_version 1.1;
proxy_read_timeout 300;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
}
but when i view the the web http://xxxx.xxx.xx.xx/pptssh/
it still 404. why?
my nginx localtion location /pptssh/ { proxy_pass http://127.0.0.1:8888; proxy_http_version 1.1; proxy_read_timeout 300; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-PORT $remote_port; } but when i view the the web http://xxxx.xxx.xx.xx/pptssh/
it still 404. why?
add this one to your Nginx config: proxy_redirect default;
just try to add slash at the end of url: proxy_pass http://127.0.0.1:8888/;