正如所描述的標題,Django不斷將我的URL從/localhost/
更改爲/127.0.0.1:8080/
,它不斷讓我的服務靜態文件被Nginx搞亂。任何想法爲什麼這樣做?謝謝!Django不斷地將URL從http:// localhost /更改爲http://127.0.0.1:8080/
/* *EDIT* */ 這裏是Nginx的配置:
server {
listen 80; ## listen for ipv4
listen [::]:80 default ipv6only=on; ## listen for ipv6
server_name localhost;
access_log /var/log/nginx/localhost.access.log;
location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|html|htm)$
{
root /srv/www/testing;
}
location/{
proxy_pass http://127.0.0.1:8080/;
proxy_redirect off;
}
location /doc {
root /usr/share;
autoindex on;
allow 127.0.0.1;
deny all;
}
location /images {
root /usr/share;
autoindex on;
}
這裏是Apache的配置文件:
<VirtualHost *:8080>
ServerName testing
DocumentRoot /srv/www/testing
<Directory /srv/www/testing>
Order allow,deny
Allow from all
</Directory>
WSGIScriptAlias//srv/www/testing/apache/django.wsgi
</VirtualHost>
你是如何建立你的網址是什麼? – Jerzyk 2011-03-29 07:43:19