question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not able to proxy requests for assets, media files

See original GitHub issue

Information

https://whatismybrowser.com/w/MLNCGRF

Details

# reverse proxy
location / {
    proxy_pass            http://127.0.0.1:3000;
    proxy_set_header Host $host;
    include               nginxconfig.io/proxy.conf;
}

Description

Wrong:

# reverse proxy
location / {
    proxy_pass            http://127.0.0.1:3000;
    proxy_set_header Host $host;
    include               nginxconfig.io/proxy.conf;
}

Correct:

# reverse proxy
location ^~ / {
    proxy_pass            http://127.0.0.1:3000;
    proxy_set_header Host $host;
    include               nginxconfig.io/proxy.conf;
}

Steps to reproduce

Open this link

Expected behavior

I expected to have ^~ after location directive.

# reverse proxy
location ^~ / {
    proxy_pass            http://127.0.0.1:3000;
    proxy_set_header Host $host;
    include               nginxconfig.io/proxy.conf;
}

See also: https://nginx.org/en/docs/http/ngx_http_core_module.html#location

In versions from 0.7.1 to 0.8.41, if a request matched the prefix location without the “=” and “^~” modifiers, the search also terminated and regular expressions were not checked.

Screenshots

image

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
MattIPv4commented, Nov 25, 2022

I don’t think disabling it would be the right move, as other domains in the tool might still be using it without a reverse proxy.

I think the best move would be to add a warning to the expires section in the tool when any domain is using the reverse proxy – we show warnings in a few other places in the tool so I think it makes sense to lean into a standard UI/UX convention here.

With that warning in place, I’m fine with then switching the proxy block to using ^~, as I believe this was probably the intended behaviour all along. As that’s then a regex operator, I believe it’ll take precedence over the expiration blocks further down in the config, 'cause the logic for regex blocks is just the first matching block in the config?

0reactions
doggy8088commented, Nov 25, 2022

@MattIPv4 Maybe turn off expires settings when enable Reverse proxy is a good choice?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Proxying assets - GitLab Docs
GitLab can be configured to use an asset proxy server when requesting external images/videos/audio in issues and comments. This helps ensure that malicious ......
Read more >
A Reverse Proxy Server Turns a Media Asset Database Into A ...
I want the files kept locally, secured using local equipment I own and maintain, and where I can control who can access the...
Read more >
Images not loading when using nginx proxy manager #452
A simple reverse proxy wont fix this, at least not for the media files. That is why the nginx container is included in...
Read more >
Could not proxy request /pusher/auth from localhost:3000 to ...
I confirm that using localhost as a proxy host is a problem on Mac. Using 127.0.0.1 fixed the issue for me. – Tim....
Read more >
Assets proxy development | Adobe Experience Manager
Learn how to configure an Experience Manager proxy, ... IDS proxy worker uses an Adobe InDesign Server to process files for use in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found