docker部署alist、reader的nginx二级目录反代配置

#PROXY-START/reader/

location ^~ /reader/ {

        proxy_pass  http://172.17.0.3:8080/; #端口自行修改为映射端口

        proxy_http_version 1.1;

        proxy_cache_bypass $http_upgrade;

        proxy_set_header Upgrade           $http_upgrade;

        proxy_set_header Connection        "upgrade";

        proxy_set_header Host              $host;

        proxy_set_header X-Real-IP         $remote_addr;

        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;

        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_set_header X-Forwarded-Host  $host;

        proxy_set_header X-Forwarded-Port  $server_port;

    }

#PROXY-END/reader/

#PROXY-START/reader3/

location ^~ /reader3/ {

        proxy_pass  http://172.17.0.3:8080/reader3/; #端口自行修改为映射端口

        proxy_http_version 1.1;

        proxy_cache_bypass $http_upgrade;

        proxy_set_header Upgrade           $http_upgrade;

        proxy_set_header Connection        "upgrade";

        proxy_set_header Host              $host;

        proxy_set_header X-Real-IP         $remote_addr;

        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;

        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_set_header X-Forwarded-Host  $host;

        proxy_set_header X-Forwarded-Port  $server_port;

    }

#PROXY-END/reader3/





#PROXY-START/



location ^~ /alist/

{

  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

  proxy_set_header Host $http_host;

  proxy_set_header X-Real-IP $remote_addr;

  proxy_set_header Range $http_range;

  proxy_set_header If-Range $http_if_range;

  proxy_redirect off;

  proxy_pass http://127.0.0.1:52440/;

  # the max size of file to upload

  client_max_body_size 20000m;

	#Set Nginx Cache



    if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )

    {

        expires 12h;

    }

    proxy_ignore_headers Set-Cookie Cache-Control expires;

    proxy_cache cache_one;

    proxy_cache_key $host$uri$is_args$args;

    proxy_cache_valid 200 304 301 302 1m;



}



#PROXY-END/

 

 

版权声明:
作者:Lewss
链接:https://www.amzcn.com/thread-021456-1.html
来源:AmzCN – 普通人的普通世界
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>
文章目录
关闭
目 录