Quantcast
Channel: Whomwah.com » howto
Viewing all articles
Browse latest Browse all 9

Fixing the trailing slash in Nginx

0
0

The solution as usual is super simple. The problem I was having was that when you didn’t put a trailing slash on a url, it would not handle it and throw a 404. I saw lots of fixes with complex re-write rules, but it turns out that a simple fix for me was to add this to my .conf file:

# http://wiki.nginx.org/NginxHttpCoreModule#server_name_in_redirect
server_name_in_redirect off;

So your *.conf would look like this

server {
  listen  80;
  server_name  localhost;
  ...
  server_name_in_redirect off;
  ...
}

Viewing all articles
Browse latest Browse all 9

Latest Images

Trending Articles





Latest Images