Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nginx trailing slash issues

I'm googling a lot and found several workarounds, but you have to define every single directory.

  • On Apache: example.com/hi -> example.com/hi/
  • On nginx: example.com/hi -> Firefox can't establish a connection to the server at example.com:8888

where 8888 is what Apache is listening on (nginx's :80 -> localhost:8888)

Any ideas how to fix this and have it just forward normally like folder?

like image 600
ry. Avatar asked May 10 '26 18:05

ry.


1 Answers

I had a similar problem with varnish and nginx (varnish on port 80 proxying to nginx listening on 8080) and needed to add "port_in_redirect off;" ... server_name_in_redirect needed to stay on so nginx knew which host it was handling.

like image 75
sstrudeau Avatar answered May 14 '26 08:05

sstrudeau