Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add client overrides to nginx configuration #3297

Merged
merged 4 commits into from
Nov 16, 2020

Conversation

kimsible
Copy link
Contributor

Description

In production client-overrides don't work with nginx because client assets were bypassed without considering client-overrides handled in PeerTube.

Related issues

Has this been tested?

I tested it with production scripts, it may need more tests ? @rigelk ?

@kimsible
Copy link
Contributor Author

Hi @JohnXLivingston, this configuration of nginx works for you ?

Copy link
Collaborator

@rigelk rigelk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not merge the two with:

location ~ ^/client/assets/images/(logo\.svg|favicon\.png|icons/icon-(36x36|48x48|72x72|96x96|144x144|192x192|512x512)\.png)$

@kimsible kimsible requested a review from rigelk November 13, 2020 13:02
@kimsible
Copy link
Contributor Author

@rigelk I've merged the rules with more explicit file names in the regexp, it's long but better, I think, to maintain.

@kimsible kimsible force-pushed the fix/client-overrides-nginx branch from 2056071 to deaf6b8 Compare November 13, 2020 17:21
@JohnXLivingston
Copy link
Contributor

Hi @JohnXLivingston, this configuration of nginx works for you ?

It works... But it is no more dynamic... If files don't exist, it fails and there are missing icons. Or I'm I missing something? (I don't really know nginx syntax)

@kimsible
Copy link
Contributor Author

kimsible commented Nov 13, 2020

Thanks @JohnXLivingston

It works... But it is no more dynamic..

Sorry I don't see what you mean by "dynamic", you mean nginx ?

If files don't exist, it fails and there are missing icons. Or I'm I missing something? (I don't really know nginx syntax)

What kind of failure ? The icons should not be missing if the dist client directory exists, would you make a screenshot or a copy of your error ?

@kimsible kimsible force-pushed the fix/client-overrides-nginx branch from deaf6b8 to fab5ecc Compare November 13, 2020 18:46
@JohnXLivingston
Copy link
Contributor

What kind of failure ? The icons should not be missing if the dist client directory exists, would you make a screenshot or a copy of your error ?

As I said, I'm not familiar with nginx configuration, perhaps I'm wrong. What happens if the try_files directive don't find the file? If it continues to the next «location ~»? In this case, my bad, it's ok.

@rigelk rigelk changed the title Add client overrides to nginx configuration add client overrides to nginx configuration Nov 16, 2020
@rigelk rigelk merged commit 8872828 into Chocobozzz:develop Nov 16, 2020
@rigelk
Copy link
Collaborator

rigelk commented Nov 16, 2020

@kimsible thanks a lot for spotting and fixing the issue!

@JohnXLivingston
Copy link
Contributor

Are the config key storage.client_overrides, the constant CLIENT_OVERRIDES_DIR and the associated code in server/controllers/client.ts still needed?

@kimsible
Copy link
Contributor Author

@JohnXLivingston

Are the config key storage.client_overrides, the constant CLIENT_OVERRIDES_DIR and the associated code in server/controllers/client.ts still needed?

Yes, as not everybody uses nginx as a reverse proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Client overrides (logo, favicon, PWA icons) does't work behind Nginx
3 participants