Tag: 国际化

何修复nginx的configuration文件,以便能够服务于不同的语言?

我使用泊坞窗来服务我的angular度应用程序,这也是使用国际化的function几种语言。 使用以下命令将docker run -d -p 9090:80 -v "$(pwd)/dist:/usr/share/nginx/html" -v "$(pwd)/app.conf:/etc/nginx/conf.d/default.conf" nginx:alpine指向dist文件夹: docker run -d -p 9090:80 -v "$(pwd)/dist:/usr/share/nginx/html" -v "$(pwd)/app.conf:/etc/nginx/conf.d/default.conf" nginx:alpine 正如你可以在命令行中看到的那样,我还将try_files指令保存在app根目录中作为app.conf ,以便在重新加载页面/应用程序或直接针对特定的路由/上下文时避免出现404 NGINX错误 。 server { listen 80; server_name localhost; root /usr/share/nginx/html; index index.html index.htm; location / { try_files $uri /index.html; } } 一切正常,我可以达到: localhost:9090/home除非当我尝试导航到一个特定的语言,如localhost:9090/es/或localhost:9090/en/然后我得到的错误: ERROR Error: Uncaught (in promise): Error: Cannot match any […]