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;
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 vs2019 mfc程序如何实现64*64/48*48大小的真彩色工具栏
  • ¥15 全志v3s耳机音频输出口怎么外接功放
  • ¥15 华为ensp使用基本ACL限制公司网络访问
  • ¥15 帮我做下照片上的PLC题
  • ¥15 labview2022 使用modbus报缺少依赖?
  • ¥15 谷歌地图是不是不开通结算功能,api会使用不了哦
  • ¥15 unity腾讯云对象存储机型适配
  • ¥15 求全国交通咨询模拟代码,要求如下,可以完全在dev c++运行
  • ¥15 根据要求修改程序编码
  • ¥15 用 Python 做一个用 Excel 表导入的答题系统