webssh icon indicating copy to clipboard operation
webssh copied to clipboard

404 when running behind nginx

Open randomairborne opened this issue 3 years ago • 4 comments

https://github.com/huashengdun/webssh/issues/215 was closed with no solution, what is the cause of this? I have the exact issue.

randomairborne avatar May 11 '21 00:05 randomairborne

@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
}

tomasodehnal avatar Jun 23 '21 12:06 tomasodehnal

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/ image

it still 404. why?

fyc119 avatar Aug 30 '21 08:08 fyc119

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/ image

it still 404. why?

add this one to your Nginx config: proxy_redirect default;

mikryashov avatar Sep 26 '21 21:09 mikryashov

just try to add slash at the end of url: proxy_pass http://127.0.0.1:8888/;

lxh2002 avatar Nov 26 '21 13:11 lxh2002