2014-10-09 88 views
1

我nginx的网站configuraton:XML网站地图通过nginx的禁止访问

upstream nodeName { 
    server serverIp:7050; 
    server serverIp:7049 backup; 
} 
server { 
    listen 80; 
    server_name domain.com; 
    gzip_types application/x-javascript text/css; 
    access_log /pathToLogs/log.access.log; 
    location/{ 
     proxy_pass http://nodeName/; 
    } 
    location ~ ^/(min/|images/|bootstrap/|ckeditor/|img/|javascripts/|apple-touch-icon-ipad.png|apple-touch-icon-ipad3.png|apple-touch-icon-iphone.png|apple-touch-icon-iphone4.png|generated/|js/|css/|stylesheets/|robots.txt|humans.txt|favicon.ico|xml/) { 
      root /pathToSite/appdirectory-build; 
      access_log off; 
      expires max; 
     } 
} 

我想通过URL http://example.com/xml/sitemap.xmlsitemap.xml,但它给了我

403 Forbidden 

nginx/1.4.6 (Ubuntu) 

更新

nginx错误日志文件:

2014/10/09 [error] 16094#0: *49762240 open() "/pathToSite/appdirectory-build/xml/sitemapCallEn.xml" failed (13: Permission denied), client: Ip, server: domain.com, request: "GET /xml/sitemapCallEn.txt HTTP/1.1", host: "domain" 

如何更改权限并允许打开xml文件?

回答

1

调查nginx错误日志。你会在那里找到答案。这可能是文件许可问题