正如标题所描述的那样,Django不断将我的URL从/ localhost /更改为/127.0.0.1:8080/,这使Nginx的静态文件变得混乱.任何想法为什么这样做?谢谢!
/**编辑**/
这是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配置文件:
ServerName testing
DocumentRoot /srv/www/testing
Order allow,deny
Allow from all
WSGIScriptAlias / /srv/www/testing/apache/django.wsgi