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 交替优化波束形成和ris反射角使保密速率最大化
  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程