我有一个angular色的应用程序通过nginx服务。 对于googlebot我想提供一个不同的静态HTML文件,以便它可以正确的索引,下面的nginxconfiguration是否正确? (我不想让使用phantomjs的设置变得复杂,我只想探索像sitemap.xml这样的其他选项,除非nginx不能完成这项工作)
location / { if ($http_user_agent ~ Googlebot) { rewrite ^/(.*)$ /forgooglebot.html break; } root /usr/share/nginx/app; try_files $uri $uri/ /index.html; }