开发者

Config nginx.conf so that .html extensions aren't displayed

I'm new to nginx configuration so not sure how to go about this, but any help would be appreciated.

I have a company.com/jobs.html page se开发者_运维问答t up, but would like to point the URL company.com/jobs to the content of company.com/jobs.html while keeping the URL as company.com/jobs

This is what I changed in my nginx.conf file:

location / {
rewrite ^/jobs$ jobs.html last;
}

Unfortunately, I'm running into some trouble and not sure what to try next. Any help is appreciated!


location ~ ^/jobs$ {
    try_files $uri.html $uri;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜