docker 容器web站点 中文文件名访问404问题

自己根据业务构建的tomcat容器,代码中含有中文文件名的访问无法识别,报404错误,设置以下环境变量后也还是不行

LC_ALL="zh_CN.UTF-8"
LC_CTYPE="zh_CN.utf8"
LANG="zh_CN.utf8"

 

最后在tomcat的脚本文件catalina.sh文件中加入   . /etc/profile  命令后,重启容器就可以识别到中文文件名了。

# head /usr/local/tomcat/bin/catalina.sh 
#!/bin/sh
. /etc/profile

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at

 

posted @ 2020-10-05 17:56  浪淘沙&  阅读(368)  评论(0编辑  收藏  举报