0

I use apache (port 8000) with nginx (port 80) to serve static files. And now I see that in sitemap.xml file I see urls like:

http://mysite:8000/slug

Can't figure out why I get it because on other websites I use pretty much the same configurations for apache and nginx... and sitemap code looks similar too. Here's the content of apache configuration file:

<VirtualHost *:8000>
    ServerName mysite
    ServerAlias www.mysite

    DocumentRoot /var/www/mysite

    WSGIProcessGroup mysite
        WSGIScriptAlias / /var/www/mysite/myapp/wsgi.py
        WSGIDaemonProcess mysite \
                python-path=/home/dmitry/.virtualenv/myapp/lib/python2.7/site-packages 

    <Directory />
        AllowOverride None
        Order Deny,Allow
        Deny from all
        <Files robots.txt>
            Order deny,allow
            Allow from All
        </Files>
    </Directory>

    <Directory /var/www/mysite/myapp>
                <Files wsgi.py>
                Order deny,allow
                Allow from All
                </Files>
                Order deny,allow
                Deny from All
        </Directory>


    <Directory /var/www/mysite/myapp/static>
        Order deny,allow
        Allow from All
    </Directory>

    Alias /static/ /var/www/mysite/myapp/static/
    Alias /robots.txt /var/www/mysite/robots.txt

    ErrorLog ${APACHE_LOG_DIR}/mysite.error.log

    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/mysite.access.log combined

</VirtualHost>

And here's nginx configuration:

server{
    listen 80;
    server_name mysite www.mysite;

    root /usr/share/nginx/www;
        index index.html index.htm;

    location /static {
        alias /var/www/mysite/myapp/static;
    }

    location /media {
        alias /var/www/mysite/myapp/media;
    }

    location / {
        proxy_pass http://mysite:8000;
    }
}

Is this thing bad for SEO?

UPDATE Here's code that I use to generate sitemap:

views.py

from django.contrib.sitemaps import Sitemap

class VideosSitemap(Sitemap):
    changefreq = 'monthly'
    priority = 0.5

    def items(self):
        return Video.objects.filter(is_published=True)

    def lastmod(self, obj):
        return obj.datetime_published

urls.py

sitemaps = {
    'videos': VideosSitemap,
}
urlpatterns = patterns('',
    ...
    url(r'^videos/sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
    ...
)
Dmitrii Mikhailov
  • 5,053
  • 7
  • 43
  • 69
  • How do you generate your `sitemap.xml`? *Off-topic:* Why do you use Apache behind nginx instead of a light WSGI server like gunicorn or uwsgi? o_O – Maxime Lorant May 18 '14 at 12:40
  • I use django sitemap framework to generate sitemap. I have heard about gunicorn, I guess I could give it a shot. Thank you for information. – Dmitrii Mikhailov May 18 '14 at 12:49

0 Answers0