mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 06:43:24 +00:00
100 lines
3.4 KiB
Nginx Configuration File
100 lines
3.4 KiB
Nginx Configuration File
worker_processes 2;
|
|
error_log ./nginx.error.log;
|
|
worker_rlimit_nofile 8192;
|
|
pid nginx.pid;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
multi_accept on;
|
|
}
|
|
|
|
http {
|
|
|
|
access_log off;
|
|
charset UTF-8;
|
|
|
|
types {
|
|
text/html html htm shtml;
|
|
text/css css;
|
|
text/xml xml rss;
|
|
image/gif gif;
|
|
image/jpeg jpeg jpg;
|
|
application/x-javascript js;
|
|
text/plain txt;
|
|
image/png png;
|
|
image/svg+xml svg;
|
|
image/x-icon ico;
|
|
application/pdf pdf;
|
|
text/cache-manifest appcache;
|
|
}
|
|
|
|
# ----------------------------------------------------------------------
|
|
# | Compression |
|
|
# ----------------------------------------------------------------------
|
|
|
|
# https://nginx.org/en/docs/http/ngx_http_gzip_module.html
|
|
brotli on;
|
|
# brotli_static on;
|
|
brotli_types *;
|
|
# Enable gzip compression.
|
|
# Default: off
|
|
gzip on;
|
|
|
|
# Compression level (1-9).
|
|
# 5 is a perfect compromise between size and CPU usage, offering about
|
|
# 75% reduction for most ASCII files (almost identical to level 9).
|
|
# Default: 1
|
|
gzip_comp_level 5;
|
|
|
|
# Don't compress anything that's already small and unlikely to shrink much
|
|
# if at all (the default is 20 bytes, which is bad as that usually leads to
|
|
# larger files after gzipping).
|
|
# Default: 20
|
|
gzip_min_length 256;
|
|
|
|
# Compress data even for clients that are connecting to us via proxies,
|
|
# identified by the "Via" header (required for CloudFront).
|
|
# Default: off
|
|
gzip_proxied any;
|
|
|
|
# Tell proxies to cache both the gzipped and regular version of a resource
|
|
# whenever the client's Accept-Encoding capabilities header varies;
|
|
# Avoids the issue where a non-gzip capable client (which is extremely rare
|
|
# today) would display gibberish if their proxy gave them the gzipped version.
|
|
# Default: off
|
|
gzip_vary on;
|
|
|
|
# Compress all output labeled with one of the following MIME-types.
|
|
# text/html is always compressed by gzip module.
|
|
# Default: text/html
|
|
gzip_types *;
|
|
|
|
# This should be turned on if you are going to have pre-compressed copies (.gz) of
|
|
# static files available. If not it should be left off as it will cause extra I/O
|
|
# for the check. It is best if you enable this in a location{} block for
|
|
# a specific directory, or on an individual server{} level.
|
|
# gzip_static on;
|
|
|
|
server {
|
|
listen 3301;
|
|
server_name localhost;
|
|
root ./build/;
|
|
index index.html;
|
|
|
|
location ~* \.(?:manifest|appcache|html?|xml|json|css|js|map|jpg|jpeg|gif|png|ico|svg|eot|ttf|woff|woff2)$ {
|
|
add_header Access-Control-Allow-Origin *;
|
|
add_header Access-Control-Allow-Credentials true;
|
|
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
|
|
add_header Access-Control-Allow-Headers 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
|
access_log off;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html =404;
|
|
}
|
|
location /iframe.html {
|
|
try_files $uri $uri/ /iframe.html =404;
|
|
}
|
|
}
|
|
}
|