cy33hc / switch-ezremote-client

GNU General Public License v3.0
44 stars 3 forks source link

[Nginx] autoindex and http 301 #16

Open pgalonza opened 1 week ago

pgalonza commented 1 week ago

Hi, I want to share my observation. I run Nginx in docker with "autoindex on" parameter for share files. Path for directory look like "\<folder>/" but application create GET request without a slash at the end and Nginx send 301 redirect.

The ngx_http_autoindex_module module processes requests ending with the slash character (‘/’) and produces a directory listing. Usually a request is passed to the ngx_http_autoindex_module module when the ngx_http_index_module module cannot find an index file.

It is not problem, but with port forwarding with different port number(8000 to 80), Nginx redirect on port which he listening(80).

cy33hc commented 15 hours ago

@pgalonza Can you give me location where you got the nginx docker. Also include your custom nginx.conf if possible. Thx.

pgalonza commented 2 hours ago

@cy33hc nginx.conf.txt

working version docker run --rm --name nginx -p 8000:8000 -v ./:/Nintendo/Switch:ro -v ./nginx.conf:/etc/nginx/nginx.conf:ro nginx:1.27

when redirect to port 80 if 'GET' request to directory without a slash at the end docker run --rm --name nginx -p 80:8000 -v ./:/Nintendo/Switch:ro -v ./nginx.conf:/etc/nginx/nginx.conf:ro nginx:1.27