M Dockerfile => Dockerfile +1 -1
@@ 10,7 10,7 @@ run npm install
run npm run build
-from docker.io/nginx:alpine-slim
+from docker.io/fholzer/nginx-brotli:latest
copy --from=build /build/dist /var/www/skovati.dev
copy nginx.conf /etc/nginx
M nginx.conf => nginx.conf +29 -26
@@ 1,52 1,55 @@
-user nginx;
-worker_processes auto;
-
-error_log /var/log/nginx/error.log notice;
-pid /var/run/nginx.pid;
+user nginx;
+worker_processes auto;
+pid /var/run/nginx.pid;
events {
- worker_connections 1024;
+ worker_connections 1024;
}
http {
+ ####################
+ # general
+ ####################
include /etc/nginx/mime.types;
default_type application/octet-stream;
- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- '$status $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
-
- access_log /var/log/nginx/access.log main;
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
+ '$status $body_bytes_sent "$http_referer" '
+ '"$http_user_agent" "$http_x_forwarded_for"';
+ access_log /var/log/nginx/access.log main;
+ error_log /var/log/nginx/error.log;
- sendfile on;
- #tcp_nopush on;
-
- keepalive_timeout 65;
+ sendfile on;
+ tcp_nopush on;
+ server_tokens off;
+ ####################
+ # compression
+ ####################
gzip on;
-
gzip_vary on;
gzip_proxied any;
gzip_comp_level 9;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
+ gzip_static on;
+ brotli on;
+ brotli_comp_level 9;
+ brotli_static on;
+ brotli_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
+
+ ####################
+ # servers
+ ####################
server {
listen 80;
listen [::]:80;
server_name skovati.dev;
- root /var/www/skovati.dev;
+ root /var/www/skovati.dev;
location / {
- index index.html;
- http2_push style.min.css;
- }
-
- #error_page 404 /404.html;
-
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root /usr/share/nginx/html;
+ index index.html;
}
}
}