Today configuration items, because static resources need to be shared, create a shared directory to do static resources, and then Java static path reference a soft link, access 404
1. Project Resource path:
Total 12drwxr-x---3 root root 4096 2 14:12 meta-infdrwxr-x---2 root root 4096 May 2 14:12 sdweblrwxrwxrwx 1 ng Inx Nginx 2 15:15 Static-/var/ckl/static/drwxr-x---5 root root 4096 May 2 14:12 Web-inf
Link as shared static resource
2. Access error 404 to resolve:
Configuring Tomcat's Context.xml
<?xml version= "1.0" encoding= "UTF-8"?><!-- 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 http:// Www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "As is" BASIS, WITHOUT WARRANTIES OR Conditions of any kind, either express or implied. see the License for the specific language governing permissions and limitations under the License.--><!-- the contents of this file will be loaded for each web application --><context > <resources allowlinking= "true" /> //Add this line <!-- default set of monitored resources. if one of these changes, the --> <!-- web Application will be reloaded. -- > <WatchedResource>WEB-INF/web.xml</WatchedResource> <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource> < !-- Uncomment this to disable session persistence across Tomcat restarts --> <!-- <manager pathname= "" / > --></Context>
3. Restart the Tomcat solution
Nginx Agent Java Project access Share link 404