Nginx’s url slash problem?

  docker, question

Configuration file

server {
 listen 80;
 server_name localhost:80;
 
 root /usr/html;
 index  index.html ;
 
 location /favicon.ico {
 log_not_found off;
 }
 
 location /aria2/ {
 proxy_pass http://localhost:6800/;
 }
 
 location /dl {
 root /aria2;
 autoindex on;
 autoindex_exact_size off;
 autoindex_localtime on;
 expires 30d;
 
 }
 }

Run in docker container, external port 33333, now the problem is accesshttp://127.0.0.1: 33333/dl, will automatically 301 jump to port 80:http://127.0.0.1/dl/, according to the search method cannot be solved
And if configured to

location /aria2 {
 proxy_pass http://localhost:6800/;
 }

Will 404

192.168.6.122 - - [15/Mar/2018:05:15:48 +0000] "POST /aria2/jsonrpc HTTP/1.1" 404 0 "http://192.168.6.235:33333/" "Mozilla/5.0 (Windows NT 6.1;  rv:51.0) Gecko/20100101 Firefox/51.0" "-"

How do you want to solve it?

I suggest you look at nginx’s error log.

Enter bash or sh of nginx and the command is docker exec -it [container name] bash

Then check at/var/log/nginx/error.log.