如何使用Nginx

时间:2019-07-18 16:49:32

标签: nginx rhel network-drive

我使用/ etc / fstab在Redhat Server 7上安装了网络驱动器。我们在该文件夹下有一个名为“ FolderA”的文件夹,其中有子文件夹。我们需要使用nginx将此文件夹作为静态文件夹位置。似乎不起作用。

我们在同一文件系统上还有一个名为static的文件夹。与nginx一起使用时,它可以正常工作。要求是在两个文件夹中都找不到这两个文件夹,而在另一个文件夹中找到它。



#    location /static/ {
#        autoindex on;
#        root /www/AutomationServices/static;
#       try_files $uri $uri/  @secondStatic;
#    }
#    location /storage/ {
#       root /storage/Investigator_Validator;
#    }
#    location @secondStatic{
#       root /storage/Investigator_Validator;
#       }
location ~ ^/static/(.*)$ {
                root /;
                autoindex on;
                try_files /www/AutomationServices/static/$1 /storage/Investigato                                                                                                             r_Validator/$1  =404;
        }

最终结果是使用nginx Web服务器将两个文件夹用作静态位置。一个文件夹位于网络驱动器中,一个文件夹位于文件系统中

0 个答案:

没有答案