这是我用于nginx docker服务的配置:
upstream back {
server django:8100;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
# Allow file uploads
client_max_body_size 10M;
proxy_buffering off;
proxy_max_temp_file_size 0;
proxy_temp_path /tmptmp;
location /api/v1 {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://back;
}
location /admin13 {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://back;
}
location /static {
root /usr/share/nginx/django_static;
}
location /ws/ {
proxy_pass http://back;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
root /usr/share/nginx/html;
}
}
我遇到的问题是,当我转到正确的地址时,路径会被追加,页面网址看起来像这样:site.com/some/path
,但是当我按下重新加载按钮时,我得到了错误。 / p>
nginx配置一定存在问题。你可以帮忙吗?