如何从 nginx 提供本地存储的 wsdl 文件

How can you serve locally stored wsdl file from nginx

我正在尝试制定一个解决方案,让我们提供从我们的 nginx 网络服务器本地存储的 wsdl 文件。使用 URL 从浏览器访问 WSDL,格式为:

https://*******/nameofthewsdl?wsdl

我正在尝试像这样在我的 vhost conf 文件中放置一个块:

 location ~ /******** {
        root /etc/nginx/docs/;
        include /etc/nginx/mime.types;

已将 wsdl 文件放在 /etc/nginx/docs 位置下,但它总是给出 404。不确定如何进行。

通过 NGINX 提供静态 XML 文件不是什么大问题。鉴于您所有的 wsdl 文件都有以 wsdl 结尾的文件,此配置应该有效。


location ~* \.(wsdl)$ {
   root /etc/nginx/docs/;
   default_type application/xml;
}