开发者

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

开发者 https://www.devze.com 2023-04-02 17:13 出处:网络
I\'m new to nginx configuration so not sure how to go about this, but any help would be appreciated.

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

精彩评论

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

关注公众号