dtrhd2850 2015-01-27 15:40 采纳率: 0%
浏览 43
已采纳

远程nginx代理服务器 - 无法从网站下载文件?

I've set up a remote reverse proxy server using nginx that is helping with traffic throttling to our website (lots of DDOS attacks lately). The website is currently built on an old version of Joomla.

When you try to download a file from the website, it redirects home rather than pushing the file download as it should.

an example link would be:

http://domain.com/index.php?option=com_docman&task=doc_download&gid=4753

My nginx config is as follows

# Initialize Rate Limiting
    limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;

    # Do Proxy Cache
    proxy_cache_path /data/nginx/cache keys_zone=one:10m loader_threshold=300 loader_files=200 max_size=200m;

    include /etc/nginx/sites-enabled/*;

    server {
            listen 80;
            server_name www.domain.com;
            return 301 $scheme://domain.com$request_uri;
    }

    server {
            listen 80;
            proxy_cache one;
            server_name domain.com;
            access_log /var/www/proxy/log/nginx.access.log;
            error_log /var/www/proxy/log/nginx_error.log debug;

            location / {
                    # apply rate limiting
                    limit_req zone=login burst=5;

                    resolver        127.0.0.1;
                    include /etc/nginx/conf.d/proxy.conf;
                    proxy_pass      http://$host$uri;
            }
    }
  • 写回答

1条回答 默认 最新

  • doucou1892 2015-01-27 16:02
    关注

    Resolved the issue.... The proxy was stripping all the request/get variables from the request. Note the changes under the "location" directive

    From

    proxy_pass      http://$host$uri;
    

    To

    proxy_pass      http://$host$request_uri;
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 在若依框架下实现人脸识别
  • ¥15 网络科学导论,网络控制
  • ¥100 安卓tv程序连接SQLSERVER2008问题
  • ¥15 利用Sentinel-2和Landsat8做一个水库的长时序NDVI的对比,为什么Snetinel-2计算的结果最小值特别小,而Lansat8就很平均
  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同