Comments (18)
Derp. So it wasn't this module. The output of the bro
command to a *.br
file doesn't have read permissions. Sorry about that--I saw the files in the directory and assumed the command would transfer permissions.
from ngx_brotli.
I cannot replicate this (neither with vanilla nginx-1.9.7 nor with ngx_openresty-1.9.7.1).
What website are you testing this with? Do you have any proxies or CDN in between?
from ngx_brotli.
I was testing my personal page placeholder @ https://toast.al/ . There's no proxies/CDN between my content and the user. According to my config, the HTML and CSS should be using brotli. I also have gzip and brotli static both enabled.. with %f.gz
& %f.br
files in the directory.
from ngx_brotli.
Actually, here's the relevant Nginx config lines:
...
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_static on;
brotli on;
brotli_types text/html text/css text/javascript application/javascript application/json image/svg+xml;
brotli_static on;
...
from ngx_brotli.
If it helps, here's my source for the site as well as my build steps for the server in the README: https://bitbucket.org/toastal/toast.al-social-page/src
from ngx_brotli.
Are you sure that your web application doesn't send compressed (read: gzipped) responses?
ngx_brotli
doesn't re-compress already compressed responses, so if it's gzipped before reaching nginx, it will be passed to the client as such.
from ngx_brotli.
I'm not 100% sure what you're asking about compressed responses and apps...
The two files are static, an index.html
file and a main.css
file. There's no app being proxied to or anything like that. Both files however do have a precompressed version for gzip_static
and brotli_static
.
The dist
directory being served from looks like this currently:
Σ /v/w/t/dist (master=) tree .
.
├── css
│ ├── main.css
│ ├── main.css.br
│ └── main.css.gz
├── fonts
│ └── fantasque-sans-mono
│ ├── FantasqueSansMono-BoldItalic.woff
│ ├── FantasqueSansMono-BoldItalic.woff2
│ ├── FantasqueSansMono-Bold.woff
│ ├── FantasqueSansMono-Bold.woff2
│ ├── FantasqueSansMono-Italic.woff
│ ├── FantasqueSansMono-Italic.woff2
│ ├── FantasqueSansMono-Regular.woff
│ └── FantasqueSansMono-Regular.woff2
├── index.html
├── index.html.br
├── index.html.gz
└── robots.txt
3 directories, 15 files
from ngx_brotli.
Well, I don't know your nginx.conf
(can you share it, please? Ideally, just minimal version that you're able to replicate this with), so I'm trying to guess what might be the source of this weird behavior.
Brotli takes precedence over gzip in all my tests...
from ngx_brotli.
worker_processes 4;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_static on;
brotli on;
brotli_types text/html text/css text/javascript application/javascript application/json image/svg+xml;
brotli_static on;
server_tokens off;
server {
listen 80;
server_name toast.al;
rewrite ^ https://$server_name$request_uri? permanent;
}
# HTTPS server
server {
listen 443 default_server ssl http2;
server_name toast.al;
add_header X-Frame-Options SAMEORIGIN;
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options nosniff;
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
... ssl stuff ...
location / {
root /var/www/toast.al-social-page/dist;
index index.html index.htm;
}
}
server {
listen 80;
listen 443 ssl http2;
server_name www.toast.al;
return 301 $scheme://toast.al$request_uri;
}
}
from ngx_brotli.
I still cannot replicate this issue, even when using your config...
Could you give me the git commit of ngx_brotli
that you've checked out?
Also, could you provide a debug log of the gzipped request?
from ngx_brotli.
Ho to set Accept-Encoding: br
?
from ngx_brotli.
If you're asking "how" to set it from the browser, only the Firefox 44+ and latest dev Chromium (behind a flag) support brotli. You'll need one of the supported browsers and they will add the accepted encoding by default.
from ngx_brotli.
Okay I updated Firefox to version 44 and I have this : Accept-Encoding :"gzip, deflate, br"
Is this the good order ?
from ngx_brotli.
Order shouldn't matter. But if you're interested, it can be modified at about:config
rule network.http.accept-encoding.secure
.
from ngx_brotli.
Thanks. I do I know if my web server is correctly configured with Brotli ?
from ngx_brotli.
How do you know? You can inspect a resource from Firefox's Network tab that should have the encoding. In the response headers of that resource you should see Content-Encoding: "br"
.
from ngx_brotli.
from ngx_brotli.
from ngx_brotli.
Related Issues (20)
- Is this project still alive? HOT 1
- the duplicate "brotli_ratio" HOT 1
- Problems confirming Brotli is enabled with online tools HOT 3
- Why on earth is this so complicated to install in Ubuntu AND have it auto-update? HOT 5
- nginx only uses br if content-length response header is missing HOT 1
- Use-After-Free problem HOT 5
- Does not compile on Debian 12 / Bookworm HOT 5
- Statically compiled installation fails HOT 13
- make[1]: Nothing to be done for 'modules' HOT 1
- cannot find -lbrotlienc HOT 3
- Statically compiled failure on debian 11 ARM HOT 1
- Still "make[1]: Nothing to be done for 'modules'" after PR HOT 6
- Statically compiled module fails to compile on arm64 HOT 2
- Brotli throwing errors on make modules: Ubuntu 22.04 HOT 4
- ''' /tmp/ngx_brotli/filter/ngx_http_brotli_filter_module.c: In function 'ngx_http_brotli_header_filter': 136.9 /tmp/ngx_brotli/filter/ngx_http_brotli_filter_module.c:322:4: error: 'ngx_table_elt_t' has no member named 'next' 136.9 322 | h->next = NULL; 136.9 | ^~ HOT 9
- nginx 1.25.2 rpm build (Fedora/COPR) + brotli/master as dynamic module FAIL: error: Brotli library is missing ... HOT 6
- compile failed with nginx when cmake build brotli return plugin needed to handle lto object HOT 6
- Statically compiled instructions fail for armv7 on raspberry pi 4 HOT 1
- Enforce Brotli over Gzip for reverse proxy HOT 1
- Docs / readme improvement: clarify behavior with reverse proxied backends
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx_brotli.