Sitemap: 404 at nginx
-
Hi,
at my multisite the sitemaps aren′t found any more (404) with the latest version of All In One SEO Pack. I use nginx.
Is this a known bug?
Regards,
-
This topic was modified 8 years, 2 months ago by
benhartwich.
-
This topic was modified 8 years, 2 months ago by
-
Hi Ben,
I’m not aware of any issues with nginx. Our sitemaps generally work out of the box with it.
Can you confirm what version it works last? https://www.ads-software.com/plugins/all-in-one-seo-pack/developers/Hi,
I′ve tested many version, but nothing changed. I think there′s a nginx rule problem, but can′t identify the problem by now. Have you had any other support topics like that, which you remember? I use the wordpress recommended nginx rules.
Regards,
I’m working on trying to reproduce it so that I can test a solution. The problem I’m having is that I can’t seem to get the sitemap to break on any normal configuration of nginx.
What host do you use?Also, what is the URL to one of the broken sitemaps?
-
This reply was modified 8 years, 2 months ago by
Michael Torbert.
Hi,
I host by myself. Example URL would be https://nichteinschalten.de/sitemap_nichteinschalten.xml
Can you paste your vhost example? Would be easier I think.
Regards,
Add the following to your config file:
rewrite ^/sitemap.xml$ /index.php?aiosp_sitemap_path=root last; rewrite ^/sitemap_(.+)_(\d+).xml$ /index.php?aiosp_sitemap_path=$1&aiosp_sitemap_page=$2 last; rewrite ^/sitemap_(.+).xml$ /index.php?aiosp_sitemap_path=$1 last;
Make sure to restart nginx.
Thanks, but I get the following error: nginx: [emerg] unknown directive “aiosp_sitemap_page=$2
Copy/paste your config file here.
As it’s been 5 days with no reply, I’m marking this as resolved.
Hello Michael Torbert ??
Sorry, I’m with the same problem, with apache okay, but with nginx, when I change the non-www domain to www, google no longer finds the sitemap of any of the server websites that I make this change with Apache, everything happens without me needing to configure anything too much, besides a simple general> settings> change url adding www, just doing this all works with serache apache, now if I use nginx, google search no longer finds the sitemaps generator by AIO seo Pack, only find those sitemaps that I do manually and upload to the public_html directory of Vhots nginx. I already did everything, even exude my property and started from scratch with 3 domains, I have already selected my preference in domain settings in domain properties for preferred https://www.mydomain.com is nothing in google, but rather something that the AIO Does not do with nginx, because if I change to apache, the AIO sitemap is immediately found. What do I do?
I’ve already tried adding this to my nginx domains and nothing happens:server {
server_name https://www.somedomain.com somedomain.com;
listen 158.69.59.25;
root /home/somedomain/public_html;
index index.php index.html index.htm;
access_log /var/log/virtualmin/somedomain.com_access_log;
error_log /var/log/virtualmin/somedomain.com_error_log;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME /home/somedomain/public_html$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT /home/somedomain/public_html;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param HTTPS $https;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
##
# cache client
##
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
access_log off;
log_not_found off;
expires 30d;
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?q=$uri&$args;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
# hercules my rewrite sginx para google search to find my sitemaps
rewrite ^/sitemap.xml$ /index.php?aiosp_sitemap_path=root last;
rewrite ^/sitemap_(.+)_(\d+).xml$ /index.php?aiosp_sitemap_path=$1&aiosp_sitemap_page=$2 last;
rewrite ^/sitemap_(.+).xml$ /index.php?aiosp_sitemap_path=$1 last;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
listen 999.99.99.99 ssl;
ssl_certificate /home/somedomain/ssl.cert;
ssl_certificate_key /home/somedomain/ssl.key;
}I have been trying your education up, but nothing happens.
Sorry for not having coded the settings, this forum wordpress thing does not allow editing after the post nor for a second, it was the end of the victories: /
@herculesnetwork: I don′t get, if you solved it or what your tried exactly. I think, it′s a general nginx problem. I tried the Yoast SEO Plugin and there′s the same problem with automatic sitemap generator. I don′t know, which nginx setting causes the problem, but it affects not just All in One SEO Pack.
This is my complete configuration:
https://gist.github.com/benhartwich/ca7ef964363200444a012a9050056c23I have tested the 6 most famous SEO plugins and their sitemaps none is found by google with nginx after I have changed the non-www URLs to www, if this happens after a change, everything leads one to believe that this is a Rewrite problem. I do not know how to work with nginx, although I have my settings quite optimized but it has been under many searches and comings and goings in forums, the performance is fantastic but the lack of support for nginx makes me think of changing it. They say if the most used nowadays, but nobody supports it, not finding this contradiction of numbers to be the most used, since neither my webmin panel supports it, I had to do several maneuvers at the time to use nginx, now that is one little better. Nginx I am noob, a script kid on nginx, my terrain is apache. But the performance gain with nginx made me migrate. In sums, we are two lost in this case, because these plugins do not support nginx.
@benhartwich What I can tell you to give you a minimal light on the case is: your definitions do not need to be changed, something is missing, a rewrite like the one written above by the author, I do not know which is the correct rewrite, but It seems that no one in the world knows: / My situation is alarming about this, I am more than 30 days beating head only with this.
@MichaelTorbert …Just for observation character, in my configs there is not that https:// srsr and yes just www …
-
This reply was modified 8 years ago by
herculesnetwork.
@benhartwich wich your php?
-
This reply was modified 8 years, 2 months ago by
- The topic ‘Sitemap: 404 at nginx’ is closed to new replies.