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 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号