Здравствуйте, всем! Не подскажите, в чем может быть проблема. Создал конфиг, для сайта без поддомена и с поддоменами. Все правила работают, кроме обработчика sitemap. https://poddomen1.site.ru/sitemap.xml - работает, обрабатывается код и выводиться xml https://poddomen2.site.ru/sitemap.xml - тоже работает https://site.ru/sitemap.xml - не работает, качает файл с кодом php их sitemap.php Код | server { server_name site.com *.site.com; ssl on; ssl_certificate ... ... charset UTF-8; index index.html index.php;
ssi on;
set $root_path /var/www/site.com; root $root_path; disable_symlinks if_not_owner from=$root_path;
location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/www/php-fpm/nginx.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $root_path$fastcgi_script_name; fastcgi_read_timeout 30; }
location / { index index.php; if (!-e $request_filename){ //ТАК НЕ РАБОТАЕТ НА ОСНОВНОМ ДОМЕНЕ, НА ПОДДОМЕНАХ НОРМ rewrite ^/sitemap.xml$ /sitemap.php last; //ЭТО ВСЕ РАБОТАЕТ И НА ОСНОВНОМ ДОМЕНЕ И НА ПОДДОМЕНАХ rewrite ^/([^/]*)/?$ /index.php?module=main&page_url=$1 last; } rewrite ^/?$ /index.php?module=main&page_url= last; }
//И ТАК НЕ РАБОТАЕТ НА ОСНОВНОМ ДОМЕНЕ location /sitemap\.xml { rewrite ^/sitemap.xml$ /sitemap.php; }
//ВСЕ ЧТО НИЖЕ РАБОТАЕТ И НА ОСНОВНОМ ДОМЕНЕ И НА ПОДДОМЕНАХ location /articles { rewrite ^/articles/([^/]+)/?$ /index.php?module=blog&url=$1 last; } ... ... ... location ~ /\.ht { access_log off; log_not_found off; deny all; }
location /robots.txt { ssi on; ssi_types text/plain; access_log off; log_not_found off; } }
|
|